Enum ruma::events::receipt::ReceiptThread
source · #[non_exhaustive]pub enum ReceiptThread {
Unthreaded,
Main,
Thread(OwnedEventId),
}
Expand description
The thread a receipt applies to.
This type can hold an arbitrary string. To build this with a custom value, convert it from an
Option<String>
with ::from()
/ .into()
. ReceiptThread::Unthreaded
can be constructed
from None
.
To check for values that are not available as a documented variant here, use its string
representation, obtained through .as_str()
.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Unthreaded
The receipt applies to the timeline, regardless of threads.
Used by clients that are not aware of threads.
This is the default.
Main
The receipt applies to the main timeline.
Used for events that don’t belong to a thread.
Thread(OwnedEventId)
The receipt applies to a thread.
Used for events that belong to a thread with the given thread root.
Implementations§
source§impl ReceiptThread
impl ReceiptThread
sourcepub fn as_str(&self) -> Option<&str>
pub fn as_str(&self) -> Option<&str>
Get the string representation of this ReceiptThread
.
ReceiptThread::Unthreaded
returns None
.
Trait Implementations§
source§impl Clone for ReceiptThread
impl Clone for ReceiptThread
source§fn clone(&self) -> ReceiptThread
fn clone(&self) -> ReceiptThread
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ReceiptThread
impl Debug for ReceiptThread
source§impl Default for ReceiptThread
impl Default for ReceiptThread
source§fn default() -> ReceiptThread
fn default() -> ReceiptThread
source§impl<'de> Deserialize<'de> for ReceiptThread
impl<'de> Deserialize<'de> for ReceiptThread
source§fn deserialize<D>(
deserializer: D,
) -> Result<ReceiptThread, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<ReceiptThread, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
source§impl Hash for ReceiptThread
impl Hash for ReceiptThread
source§impl PartialEq for ReceiptThread
impl PartialEq for ReceiptThread
source§fn eq(&self, other: &ReceiptThread) -> bool
fn eq(&self, other: &ReceiptThread) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for ReceiptThread
impl Serialize for ReceiptThread
source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
source§impl<T> TryFrom<Option<T>> for ReceiptThread
impl<T> TryFrom<Option<T>> for ReceiptThread
impl Eq for ReceiptThread
impl StructuralPartialEq for ReceiptThread
Auto Trait Implementations§
impl Freeze for ReceiptThread
impl RefUnwindSafe for ReceiptThread
impl Send for ReceiptThread
impl Sync for ReceiptThread
impl Unpin for ReceiptThread
impl UnwindSafe for ReceiptThread
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.