#[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: EventEncryptionAlgorithmThe encryption algorithm to be used to encrypt messages sent in this room.
Must be m.megolm.v1.aes-sha2.
encrypt_state_events: boolWhether 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 MSC4362.
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 From<RoomEncryptionEventContent> for PossiblyRedactedRoomEncryptionEventContent
impl From<RoomEncryptionEventContent> for PossiblyRedactedRoomEncryptionEventContent
Source§fn from(
value: RoomEncryptionEventContent,
) -> PossiblyRedactedRoomEncryptionEventContent
fn from( value: RoomEncryptionEventContent, ) -> PossiblyRedactedRoomEncryptionEventContent
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.impl JsonCastable<AnyStateEventContent> for RoomEncryptionEventContent
impl JsonCastable<Map<String, Value>> for RoomEncryptionEventContent
impl JsonCastable<PossiblyRedactedRoomEncryptionEventContent> for RoomEncryptionEventContent
impl JsonCastable<RedactedRoomEncryptionEventContent> for RoomEncryptionEventContent
Auto Trait Implementations§
impl Freeze for RoomEncryptionEventContent
impl RefUnwindSafe for RoomEncryptionEventContent
impl Send for RoomEncryptionEventContent
impl Sync for RoomEncryptionEventContent
impl Unpin for RoomEncryptionEventContent
impl UnwindSafe for RoomEncryptionEventContent
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,
Source§impl<T> EventContentFromType for Twhere
T: StaticEventContent + DeserializeOwned,
impl<T> EventContentFromType for Twhere
T: StaticEventContent + DeserializeOwned,
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<> Read more