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.
Trait Implementations§
Source§impl Clone for RoomKeyWithheldContent
impl Clone for RoomKeyWithheldContent
Source§fn clone(&self) -> RoomKeyWithheldContent
fn clone(&self) -> RoomKeyWithheldContent
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 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>,
Deserialize this value from the given Serde deserializer. Read more
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"
The event type of the event content.
Source§fn event_type(&self) -> &'static str
fn event_type(&self) -> &'static str
Get the event type of the event content. Read more
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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