File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -317,7 +317,26 @@ impl Client {
317
317
* homeserver = homeserver_url;
318
318
}
319
319
320
- async fn get_supported_versions ( & self ) -> HttpResult < get_supported_versions:: Response > {
320
+ /// Get the versions supported by the homeserver.
321
+ ///
322
+ /// This method should be used to check that a server is a valid Matrix
323
+ /// homeserver.
324
+ ///
325
+ /// # Example
326
+ /// ```no_run
327
+ /// # use futures::executor::block_on;
328
+ /// # block_on(async {
329
+ /// use matrix_sdk::{Client};
330
+ /// use url::Url;
331
+ ///
332
+ /// let homeserver = Url::parse("http://example.com")?;
333
+ /// let client = Client::new(homeserver)?;
334
+ ///
335
+ /// // Check that it is a valid homeserver.
336
+ /// client.get_supported_versions().await?;
337
+ /// # Result::<_, anyhow::Error>::Ok(()) });
338
+ /// ```
339
+ pub async fn get_supported_versions ( & self ) -> HttpResult < get_supported_versions:: Response > {
321
340
self . send (
322
341
get_supported_versions:: Request :: new ( ) ,
323
342
Some ( RequestConfig :: new ( ) . disable_retry ( ) ) ,
You can’t perform that action at this time.
0 commit comments