pub enum FullStateEventContent<C: StaticStateEventContent + RedactContent> {
Original {
content: C,
prev_content: Option<C::PossiblyRedacted>,
},
Redacted(C::Redacted),
}
Expand description
A possibly-redacted state event content.
A non-redacted content also contains the prev_content
from the unsigned event data.
Variants§
Original
Original, unredacted content of the event.
Fields
§
content: C
Current content of the room state.
§
prev_content: Option<C::PossiblyRedacted>
Previous content of the room state.
Redacted(C::Redacted)
Redacted content of the event.
Implementations§
source§impl<C: StaticStateEventContent + RedactContent> FullStateEventContent<C>where
C::Redacted: RedactedStateEventContent,
impl<C: StaticStateEventContent + RedactContent> FullStateEventContent<C>where
C::Redacted: RedactedStateEventContent,
sourcepub fn event_type(&self) -> StateEventType
pub fn event_type(&self) -> StateEventType
Get the event’s type, like m.room.create
.
sourcepub fn redact(self, version: &RoomVersionId) -> C::Redacted
pub fn redact(self, version: &RoomVersionId) -> C::Redacted
Transform self
into a redacted form (removing most or all fields) according to the spec.
If self
is already Redacted
, return the inner data unmodified.
A small number of events have room-version specific redaction behavior, so a version has to be specified.
Trait Implementations§
source§impl<C: Clone + StaticStateEventContent + RedactContent> Clone for FullStateEventContent<C>
impl<C: Clone + StaticStateEventContent + RedactContent> Clone for FullStateEventContent<C>
source§fn clone(&self) -> FullStateEventContent<C>
fn clone(&self) -> FullStateEventContent<C>
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<C: Debug + StaticStateEventContent + RedactContent> Debug for FullStateEventContent<C>
impl<C: Debug + StaticStateEventContent + RedactContent> Debug for FullStateEventContent<C>
Auto Trait Implementations§
impl<C> Freeze for FullStateEventContent<C>where
C: Freeze,
<C as RedactContent>::Redacted: Freeze,
<C as StaticStateEventContent>::PossiblyRedacted: Freeze,
impl<C> RefUnwindSafe for FullStateEventContent<C>where
C: RefUnwindSafe,
<C as RedactContent>::Redacted: RefUnwindSafe,
<C as StaticStateEventContent>::PossiblyRedacted: RefUnwindSafe,
impl<C> Send for FullStateEventContent<C>where
C: Send,
<C as RedactContent>::Redacted: Send,
<C as StaticStateEventContent>::PossiblyRedacted: Send,
impl<C> Sync for FullStateEventContent<C>where
C: Sync,
<C as RedactContent>::Redacted: Sync,
<C as StaticStateEventContent>::PossiblyRedacted: Sync,
impl<C> Unpin for FullStateEventContent<C>where
C: Unpin,
<C as RedactContent>::Redacted: Unpin,
<C as StaticStateEventContent>::PossiblyRedacted: Unpin,
impl<C> UnwindSafe for FullStateEventContent<C>where
C: UnwindSafe,
<C as RedactContent>::Redacted: UnwindSafe,
<C as StaticStateEventContent>::PossiblyRedacted: UnwindSafe,
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)