Show Option<EncryptionInfo> event handler context in doc example
parent
24253128ae
commit
d6d51ef4b1
|
@ -923,6 +923,7 @@ impl Client {
|
||||||
/// ```no_run
|
/// ```no_run
|
||||||
/// # let client: matrix_sdk::Client = unimplemented!();
|
/// # let client: matrix_sdk::Client = unimplemented!();
|
||||||
/// use matrix_sdk::{
|
/// use matrix_sdk::{
|
||||||
|
/// deserialized_responses::EncryptionInfo,
|
||||||
/// room::Room,
|
/// room::Room,
|
||||||
/// ruma::{
|
/// ruma::{
|
||||||
/// events::{
|
/// events::{
|
||||||
|
@ -940,13 +941,22 @@ impl Client {
|
||||||
/// # let _ = async {
|
/// # let _ = async {
|
||||||
/// client
|
/// client
|
||||||
/// .register_event_handler(
|
/// .register_event_handler(
|
||||||
/// |ev: SyncMessageEvent<MessageEventContent>, room: Room, client: Client| async move {
|
/// |ev: SyncStateEvent<TopicEventContent>, room: Room, client: Client| async move {
|
||||||
/// // Common usage: Room event plus room and client.
|
/// // Common usage: Room event plus room and client.
|
||||||
/// },
|
/// },
|
||||||
/// )
|
/// )
|
||||||
/// .await
|
/// .await
|
||||||
|
/// .register_event_handler(
|
||||||
|
/// |ev: SyncMessageEvent<MessageEventContent>,
|
||||||
|
/// room: Room,
|
||||||
|
/// encryption_info: Option<EncryptionInfo>| async move {
|
||||||
|
/// // An `Option<EncryptionInfo>` parameter lets you distinguish between
|
||||||
|
/// // unencrypted events and events that were decrypted by the SDK.
|
||||||
|
/// },
|
||||||
|
/// )
|
||||||
|
/// .await
|
||||||
/// .register_event_handler(|ev: SyncStateEvent<TopicEventContent>| async move {
|
/// .register_event_handler(|ev: SyncStateEvent<TopicEventContent>| async move {
|
||||||
/// // Also possible: Omit any or all arguments after the first.
|
/// // You can omit any or all arguments after the first.
|
||||||
/// })
|
/// })
|
||||||
/// .await;
|
/// .await;
|
||||||
///
|
///
|
||||||
|
|
Loading…
Reference in New Issue