#[non_exhaustive]pub struct RoomEncryptionEventContent {
pub algorithm: EventEncryptionAlgorithm,
pub encrypt_state_events: bool,
pub rotation_period_ms: Option<UInt>,
pub rotation_period_msgs: Option<UInt>,
}
Expand description
The content of an m.room.encryption
event.
Defines how messages sent in this room should be encrypted.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.algorithm: EventEncryptionAlgorithm
The encryption algorithm to be used to encrypt messages sent in this room.
Must be m.megolm.v1.aes-sha2
.
encrypt_state_events: bool
Whether state events should be encrypted alongside message-like events.
rotation_period_ms: Option<UInt>
How long the session should be used before changing it.
uint!(604800000)
(a week) is the recommended default.
rotation_period_msgs: Option<UInt>
How many messages should be sent before changing the session.
uint!(100)
is the recommended default.
Implementations§
Source§impl RoomEncryptionEventContent
impl RoomEncryptionEventContent
Sourcepub fn new(algorithm: EventEncryptionAlgorithm) -> Self
pub fn new(algorithm: EventEncryptionAlgorithm) -> Self
Creates a new RoomEncryptionEventContent
with the given algorithm.
Sourcepub fn with_recommended_defaults() -> Self
pub fn with_recommended_defaults() -> Self
Creates a new RoomEncryptionEventContent
with the mandatory algorithm and the recommended
defaults.
Note that changing the values of the fields is not a breaking change and you shouldn’t rely on those specific values.
Sourcepub fn with_encrypted_state(self) -> Self
pub fn with_encrypted_state(self) -> Self
Enable encrypted state as specified in MSC3414.
Trait Implementations§
Source§impl Clone for RoomEncryptionEventContent
impl Clone for RoomEncryptionEventContent
Source§fn clone(&self) -> RoomEncryptionEventContent
fn clone(&self) -> RoomEncryptionEventContent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for RoomEncryptionEventContent
impl Debug for RoomEncryptionEventContent
Source§impl<'de> Deserialize<'de> for RoomEncryptionEventContent
impl<'de> Deserialize<'de> for RoomEncryptionEventContent
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 From<RoomEncryptionEventContent> for AnyStateEventContent
impl From<RoomEncryptionEventContent> for AnyStateEventContent
Source§fn from(c: RoomEncryptionEventContent) -> Self
fn from(c: RoomEncryptionEventContent) -> Self
Source§impl RedactContent for RoomEncryptionEventContent
impl RedactContent for RoomEncryptionEventContent
Source§type Redacted = RedactedRoomEncryptionEventContent
type Redacted = RedactedRoomEncryptionEventContent
Source§fn redact(self, _rules: &RedactionRules) -> RedactedRoomEncryptionEventContent
fn redact(self, _rules: &RedactionRules) -> RedactedRoomEncryptionEventContent
self
into a redacted form (removing most or all fields) according to the spec. Read moreSource§impl StateEventContent for RoomEncryptionEventContent
impl StateEventContent for RoomEncryptionEventContent
Source§type StateKey = EmptyStateKey
type StateKey = EmptyStateKey
state_key
field.Source§fn event_type(&self) -> StateEventType
fn event_type(&self) -> StateEventType
m.room.name
.Source§impl StaticStateEventContent for RoomEncryptionEventContent
impl StaticStateEventContent for RoomEncryptionEventContent
Source§type PossiblyRedacted = PossiblyRedactedRoomEncryptionEventContent
type PossiblyRedacted = PossiblyRedactedRoomEncryptionEventContent
Source§type Unsigned = StateUnsigned<<RoomEncryptionEventContent as StaticStateEventContent>::PossiblyRedacted>
type Unsigned = StateUnsigned<<RoomEncryptionEventContent as StaticStateEventContent>::PossiblyRedacted>
unsigned
field.