From d6d51ef4b10fbe11e0b33315a3869f9a121a7234 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Fri, 10 Sep 2021 17:12:17 +0200 Subject: [PATCH] Show Option event handler context in doc example --- matrix_sdk/src/client.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/matrix_sdk/src/client.rs b/matrix_sdk/src/client.rs index 272c49e3..bb61c28a 100644 --- a/matrix_sdk/src/client.rs +++ b/matrix_sdk/src/client.rs @@ -923,6 +923,7 @@ impl Client { /// ```no_run /// # let client: matrix_sdk::Client = unimplemented!(); /// use matrix_sdk::{ + /// deserialized_responses::EncryptionInfo, /// room::Room, /// ruma::{ /// events::{ @@ -940,13 +941,22 @@ impl Client { /// # let _ = async { /// client /// .register_event_handler( - /// |ev: SyncMessageEvent, room: Room, client: Client| async move { + /// |ev: SyncStateEvent, room: Room, client: Client| async move { /// // Common usage: Room event plus room and client. /// }, /// ) /// .await + /// .register_event_handler( + /// |ev: SyncMessageEvent, + /// room: Room, + /// encryption_info: Option| async move { + /// // An `Option` parameter lets you distinguish between + /// // unencrypted events and events that were decrypted by the SDK. + /// }, + /// ) + /// .await /// .register_event_handler(|ev: SyncStateEvent| async move { - /// // Also possible: Omit any or all arguments after the first. + /// // You can omit any or all arguments after the first. /// }) /// .await; ///