Add example to the Client::send() doccomment

master
Marcel 2020-05-28 16:59:30 +02:00 committed by Damir Jelić
parent 1d00f79675
commit 6a323525b5
1 changed files with 18 additions and 0 deletions

View File

@ -926,6 +926,24 @@ impl Client {
/// # Arguments /// # Arguments
/// ///
/// * `request` - A filled out and valid request for the endpoint to be hit /// * `request` - A filled out and valid request for the endpoint to be hit
///
/// # Example
///
/// ```compile_fail
/// use matrix_sdk::api::r0::profile;
///
/// // First construct the request you want to make
/// // See https://docs.rs/ruma-client-api/latest/ruma_client_api/index.html
/// // for all available Endpoints
/// let request = profile::get_profile::Request {
/// user_id: mxid.clone(),
/// };
///
/// // Start the request using Client::send()
/// let resp = client.send(request).await.unwrap();
///
/// // Check the corresponding Response struct to find out what types are returned
/// ```
pub async fn send<Request: Endpoint<ResponseError = crate::api::Error> + std::fmt::Debug>( pub async fn send<Request: Endpoint<ResponseError = crate::api::Error> + std::fmt::Debug>(
&self, &self,
request: Request, request: Request,