#[non_exhaustive]pub enum Relation {
Reply {
in_reply_to: InReplyTo,
},
Replacement(Replacement),
Reference(Reference),
Annotation(Annotation),
Thread(Thread),
}Expand description
Relationship information about an encrypted event.
Outside of the encrypted payload to support server aggregation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Reply
An m.in_reply_to relation indicating that the event is a reply to another event.
Replacement(Replacement)
An event that replaces another event.
Reference(Reference)
A reference to another event.
Annotation(Annotation)
An annotation to an event.
Thread(Thread)
An event that belongs to a thread.
Implementations§
Source§impl Relation
impl Relation
Sourcepub fn rel_type(&self) -> Option<RelationType>
pub fn rel_type(&self) -> Option<RelationType>
The type of this Relation.
Returns an Option because the Reply relation does not have arel_type field.
Sourcepub fn data(&self) -> Cow<'_, JsonObject>
pub fn data(&self) -> Cow<'_, JsonObject>
The associated data.
The returned JSON object holds the contents of m.relates_to, including rel_type and
event_id if present, but not things like m.new_content for m.replace relations that
live next to m.relates_to.
Prefer to use the public variants of Relation where possible; this method is meant to
be used for custom relations only.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Relation
impl<'de> Deserialize<'de> for Relation
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<RelationWithoutReplacement> for Relation
impl From<RelationWithoutReplacement> for Relation
Source§fn from(value: RelationWithoutReplacement) -> Self
fn from(value: RelationWithoutReplacement) -> Self
Auto Trait Implementations§
impl Freeze for Relation
impl RefUnwindSafe for Relation
impl Send for Relation
impl Sync for Relation
impl Unpin for Relation
impl UnwindSafe for Relation
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, 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