Struct ruma_common::events::room_key::ToDeviceRoomKeyEventContent
source · pub struct ToDeviceRoomKeyEventContent {
pub algorithm: EventEncryptionAlgorithm,
pub room_id: OwnedRoomId,
pub session_id: String,
pub session_key: String,
}Available on crate feature
events only.Expand description
The content of an m.room_key event.
Typically encrypted as an m.room.encrypted event, then sent as a to-device event.
Fields§
§algorithm: EventEncryptionAlgorithmThe encryption algorithm the key in this event is to be used with.
Must be m.megolm.v1.aes-sha2.
room_id: OwnedRoomIdThe room where the key is used.
session_id: StringThe ID of the session that the key is for.
session_key: StringThe key to be exchanged.
Implementations§
source§impl ToDeviceRoomKeyEventContent
impl ToDeviceRoomKeyEventContent
sourcepub fn new(
algorithm: EventEncryptionAlgorithm,
room_id: OwnedRoomId,
session_id: String,
session_key: String
) -> Self
pub fn new(
algorithm: EventEncryptionAlgorithm,
room_id: OwnedRoomId,
session_id: String,
session_key: String
) -> Self
Creates a new ToDeviceRoomKeyEventContent with the given algorithm, room ID, session ID
and session key.
Trait Implementations§
source§impl Clone for ToDeviceRoomKeyEventContent
impl Clone for ToDeviceRoomKeyEventContent
source§fn clone(&self) -> ToDeviceRoomKeyEventContent
fn clone(&self) -> ToDeviceRoomKeyEventContent
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for ToDeviceRoomKeyEventContent
impl Debug for ToDeviceRoomKeyEventContent
source§impl<'de> Deserialize<'de> for ToDeviceRoomKeyEventContent
impl<'de> Deserialize<'de> for ToDeviceRoomKeyEventContent
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl EventContent for ToDeviceRoomKeyEventContent
impl EventContent for ToDeviceRoomKeyEventContent
§type EventType = ToDeviceEventType
type EventType = ToDeviceEventType
The Rust enum for the event kind’s known types.
source§fn event_type(&self) -> Self::EventType
fn event_type(&self) -> Self::EventType
Get the event’s type, like
m.room.message.source§impl From<ToDeviceRoomKeyEventContent> for AnyToDeviceEventContent
impl From<ToDeviceRoomKeyEventContent> for AnyToDeviceEventContent
source§fn from(c: ToDeviceRoomKeyEventContent) -> Self
fn from(c: ToDeviceRoomKeyEventContent) -> Self
Converts to this type from the input type.