pub enum RoomKeyWithheldContent {
MegolmV1AesSha2(MegolmV1AesSha2WithheldContent),
Unknown(UnknownRoomKeyWithHeld),
}Expand description
The m.room_key.withheld event content.
This is an enum over the different room key algorithms we support.
Devices that purposely do not send megolm keys to a device may instead send an m.room_key.withheld event as a to-device message to the device to indicate that it should not expect to receive keys for the message.
Variants§
MegolmV1AesSha2(MegolmV1AesSha2WithheldContent)
The m.megolm.v1.aes-sha2 variant of the m.room_key.withheld content.
Unknown(UnknownRoomKeyWithHeld)
An unknown and unsupported variant of the m.room_key.withheld content.
Implementations§
Source§impl RoomKeyWithheldContent
impl RoomKeyWithheldContent
Sourcepub fn new(
algorithm: EventEncryptionAlgorithm,
code: WithheldCode,
room_id: OwnedRoomId,
session_id: String,
sender_key: Curve25519PublicKey,
from_device: OwnedDeviceId,
) -> Self
pub fn new( algorithm: EventEncryptionAlgorithm, code: WithheldCode, room_id: OwnedRoomId, session_id: String, sender_key: Curve25519PublicKey, from_device: OwnedDeviceId, ) -> Self
Creates a withheld content from the given info
§Panics
The method will panic if a unsupported algorithm is given. The only
supported algorithm as of now is m.megolm.v1.aes-sha2.
Sourcepub fn withheld_code(&self) -> WithheldCode
pub fn withheld_code(&self) -> WithheldCode
Get the withheld code of this event.
Sourcepub fn algorithm(&self) -> EventEncryptionAlgorithm
pub fn algorithm(&self) -> EventEncryptionAlgorithm
Get the algorithm of the room key withheld.
Sourcepub fn megolm_session_id(&self) -> Option<&str>
pub fn megolm_session_id(&self) -> Option<&str>
Get the megolm session ID of the withheld session, if it is in fact a megolm session.
Trait Implementations§
Source§impl Clone for RoomKeyWithheldContent
impl Clone for RoomKeyWithheldContent
Source§fn clone(&self) -> RoomKeyWithheldContent
fn clone(&self) -> RoomKeyWithheldContent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RoomKeyWithheldContent
impl Debug for RoomKeyWithheldContent
Source§impl<'de> Deserialize<'de> for RoomKeyWithheldContent
impl<'de> Deserialize<'de> for RoomKeyWithheldContent
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>,
Source§impl EventType for RoomKeyWithheldContent
impl EventType for RoomKeyWithheldContent
Source§const EVENT_TYPE: &'static str = "m.room_key.withheld"
const EVENT_TYPE: &'static str = "m.room_key.withheld"
Source§fn event_type(&self) -> &str
fn event_type(&self) -> &str
Source§impl Serialize for RoomKeyWithheldContent
impl Serialize for RoomKeyWithheldContent
impl JsonCastable<AnyToDeviceEventContent> for RoomKeyWithheldContent
Auto Trait Implementations§
impl Freeze for RoomKeyWithheldContent
impl RefUnwindSafe for RoomKeyWithheldContent
impl Send for RoomKeyWithheldContent
impl Sync for RoomKeyWithheldContent
impl Unpin for RoomKeyWithheldContent
impl UnwindSafe for RoomKeyWithheldContent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more