pub struct ToDeviceRequest {
    pub event_type: ToDeviceEventType,
    pub txn_id: OwnedTransactionId,
    pub messages: BTreeMap<OwnedUserId, BTreeMap<DeviceIdOrAllDevices, Raw<AnyToDeviceEventContent>>>,
}
Expand description

Customized version of ruma_client_api::to_device::send_event_to_device::v3::Request

Fields

event_type: ToDeviceEventType

Type of event being sent to each device.

txn_id: OwnedTransactionId

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

messages: BTreeMap<OwnedUserId, 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

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

Converts to this type from the input type.

Converts to this type from the input type.

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

Returns the argument unchanged.

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

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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)

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more