#[non_exhaustive]pub struct ToDeviceRoomKeyWithheldEventContent {
pub algorithm: EventEncryptionAlgorithm,
pub code: RoomKeyWithheldCodeInfo,
pub reason: Option<String>,
pub sender_key: Base64,
}
Expand description
The content of an m.room_key.withheld
event.
Typically encrypted as an m.room.encrypted
event, then sent as a to-device event.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.algorithm: EventEncryptionAlgorithm
The encryption algorithm the key in this event is to be used with.
Must be m.megolm.v1.aes-sha2
.
code: RoomKeyWithheldCodeInfo
A machine-readable code for why the megolm key was not sent.
reason: Option<String>
A human-readable reason for why the key was not sent.
The receiving client should only use this string if it does not understand the code.
sender_key: Base64
The unpadded base64-encoded device curve25519 key of the event’s sender.
Implementations§
Source§impl ToDeviceRoomKeyWithheldEventContent
impl ToDeviceRoomKeyWithheldEventContent
Sourcepub fn new(
algorithm: EventEncryptionAlgorithm,
code: RoomKeyWithheldCodeInfo,
sender_key: Base64,
) -> Self
pub fn new( algorithm: EventEncryptionAlgorithm, code: RoomKeyWithheldCodeInfo, sender_key: Base64, ) -> Self
Creates a new ToDeviceRoomKeyWithheldEventContent
with the given algorithm, code and
sender key.
Trait Implementations§
Source§impl Clone for ToDeviceRoomKeyWithheldEventContent
impl Clone for ToDeviceRoomKeyWithheldEventContent
Source§fn clone(&self) -> ToDeviceRoomKeyWithheldEventContent
fn clone(&self) -> ToDeviceRoomKeyWithheldEventContent
Returns a duplicate 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<'de> Deserialize<'de> for ToDeviceRoomKeyWithheldEventContent
impl<'de> Deserialize<'de> for ToDeviceRoomKeyWithheldEventContent
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 From<ToDeviceRoomKeyWithheldEventContent> for AnyToDeviceEventContent
impl From<ToDeviceRoomKeyWithheldEventContent> for AnyToDeviceEventContent
Source§fn from(c: ToDeviceRoomKeyWithheldEventContent) -> Self
fn from(c: ToDeviceRoomKeyWithheldEventContent) -> Self
Converts to this type from the input type.
Source§impl ToDeviceEventContent for ToDeviceRoomKeyWithheldEventContent
impl ToDeviceEventContent for ToDeviceRoomKeyWithheldEventContent
Source§fn event_type(&self) -> ToDeviceEventType
fn event_type(&self) -> ToDeviceEventType
Get the event’s type, like
m.room_key
.impl JsonCastable<AnyToDeviceEventContent> for ToDeviceRoomKeyWithheldEventContent
impl JsonCastable<Map<String, Value>> for ToDeviceRoomKeyWithheldEventContent
Auto Trait Implementations§
impl Freeze for ToDeviceRoomKeyWithheldEventContent
impl RefUnwindSafe for ToDeviceRoomKeyWithheldEventContent
impl Send for ToDeviceRoomKeyWithheldEventContent
impl Sync for ToDeviceRoomKeyWithheldEventContent
impl Unpin for ToDeviceRoomKeyWithheldEventContent
impl UnwindSafe for ToDeviceRoomKeyWithheldEventContent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more