Struct matrix_sdk_crypto::ToDeviceRequest[][src]

pub struct ToDeviceRequest {
    pub event_type: EventType,
    pub txn_id: Uuid,
    pub messages: BTreeMap<UserId, BTreeMap<DeviceIdOrAllDevices, Raw<AnyToDeviceEventContent>>>,
}
Expand description

Customized version of ruma_client_api::r0::to_device::send_event_to_device::Request, using a UUID for the transaction ID.

Fields

event_type: EventType

Type of event being sent to each device.

txn_id: Uuid

A request identifier unique to the access token used to send the request.

messages: BTreeMap<UserId, BTreeMap<DeviceIdOrAllDevices, Raw<AnyToDeviceEventContent>>>

A map of users to devices to a content for a message event to be sent to the user’s device. Individual message events can be sent to devices, but all events must be of the same type. The content’s type for this field will be updated in a future release, until then you can create a value using serde_json::value::to_raw_value.

Implementations

Gets the transaction ID as a string.

Get the number of unique messages this request contains.

Note: A single message may be sent to multiple devices, so this may or may not be the number of devices that will receive the messages as well.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Performs the conversion.

Performs the conversion.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.