pub enum RelationWithoutReplacement {
Reply {
in_reply_to: InReplyTo,
},
Thread(Thread),
// some variants omitted
}
Expand description
Message event relationship, except a replacement.
Variants§
Reply
An m.in_reply_to
relation indicating that the event is a reply to another event.
Thread(Thread)
An event that belongs to a thread.
Implementations§
source§impl RelationWithoutReplacement
impl RelationWithoutReplacement
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 Clone for RelationWithoutReplacement
impl Clone for RelationWithoutReplacement
source§fn clone(&self) -> RelationWithoutReplacement
fn clone(&self) -> RelationWithoutReplacement
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 RelationWithoutReplacement
impl Debug for RelationWithoutReplacement
Auto Trait Implementations§
impl Freeze for RelationWithoutReplacement
impl RefUnwindSafe for RelationWithoutReplacement
impl Send for RelationWithoutReplacement
impl Sync for RelationWithoutReplacement
impl Unpin for RelationWithoutReplacement
impl UnwindSafe for RelationWithoutReplacement
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)