Struct ruma::events::room_key::RoomKeyToDeviceEventContent [−][src]
pub struct RoomKeyToDeviceEventContent {
pub algorithm: EventEncryptionAlgorithm,
pub room_id: RoomId,
pub session_id: String,
pub session_key: String,
}
events
only.Expand description
The payload for RoomKeyEvent
.
Typically encrypted as an m.room.encrypted event, then sent as a to-device event.
Fields
algorithm: EventEncryptionAlgorithm
The encryption algorithm the key in this event is to be used with.
Must be m.megolm.v1.aes-sha2
.
room_id: RoomId
The room where the key is used.
session_id: String
The ID of the session that the key is for.
session_key: String
The key to be exchanged.
Implementations
pub fn new(
algorithm: EventEncryptionAlgorithm,
room_id: RoomId,
session_id: String,
session_key: String
) -> RoomKeyToDeviceEventContent
pub fn new(
algorithm: EventEncryptionAlgorithm,
room_id: RoomId,
session_id: String,
session_key: String
) -> RoomKeyToDeviceEventContent
Creates a new RoomKeyToDeviceEventContent
with the given algorithm, room ID, session ID
and session key.
Trait Implementations
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<RoomKeyToDeviceEventContent, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<RoomKeyToDeviceEventContent, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
A matrix event identifier, like m.room.message
.
pub fn from_parts(
ev_type: &str,
content: &RawValue
) -> Result<RoomKeyToDeviceEventContent, Error>
pub fn from_parts(
ev_type: &str,
content: &RawValue
) -> Result<RoomKeyToDeviceEventContent, Error>
Constructs the given event content.
Performs the conversion.
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for RoomKeyToDeviceEventContent
impl Send for RoomKeyToDeviceEventContent
impl Sync for RoomKeyToDeviceEventContent
impl Unpin for RoomKeyToDeviceEventContent
impl UnwindSafe for RoomKeyToDeviceEventContent
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
pub fn vzip(self) -> V
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