Add async context to register_event_handler doctest

This commit is contained in:
Jonas Platte 2021-09-09 00:49:04 +02:00
parent 97731d1240
commit c3081de611
No known key found for this signature in database
GPG key ID: 7D261D771D915378

View file

@ -917,6 +917,7 @@ impl Client {
/// }; /// };
/// use serde::{Deserialize, Serialize}; /// use serde::{Deserialize, Serialize};
/// ///
/// # let _ = async {
/// client /// client
/// .register_event_handler( /// .register_event_handler(
/// |ev: SyncMessageEvent<MessageEventContent>, room: Room, client: Client| async move { /// |ev: SyncMessageEvent<MessageEventContent>, room: Room, client: Client| async move {
@ -944,6 +945,7 @@ impl Client {
/// todo!("Display the token"); /// todo!("Display the token");
/// }, /// },
/// ).await; /// ).await;
/// # };
/// ``` /// ```
pub async fn register_event_handler<Ev, Ctx, H>(&self, handler: H) -> &Self pub async fn register_event_handler<Ev, Ctx, H>(&self, handler: H) -> &Self
where where