pub struct ThreadId(pub MessageId);Expand description
Reply thread identifier.
A message that isn’t a reply and other messages that reply to it directly or
indirectly through a reply chain constitute a reply thread. All messages
except the initial root message have an additional thread_id field that
is equal to the root message’s id.
In other words a thread id can be found recursively following
reply_to_message_id, until you find a message which does not reply to
anything, it’s id is the thread id.
For example:
lizard: Hi {id:17} <-------------+--------------+----+--------------+---------------------+
| | | | |
wizard: hewwo {id:18, reply: 17 -+, thread: 17 -+} | | |
| | |
lizard: I've been wondering [...] {id:19, reply: 17 -+, thread: 17 -+} <---+ |
| |
neushoorn: wait, did y'all know that [...] {id:20} <-----------------------)--------------)--+-----+
| | | |
wizard: so this is not an easy question, actually [...] {id:21, reply: 19 -+, thread: 17 -+} | |
+--------+ |
| |
wizard: everyone knows that, how did you not know that before?... {id:22, reply:20 -+, thread: 20 -+}Note that channel comments and forum topics, reuse threads for different meanings. For channel comments every comment (indirectly) replies to the channel post forwarded to the linked chat (i.e. the forwarded channel post is the root of the comments thread). For forum topics every message in a topic is in the same thread too (i.e. they (indirectly) reply to the start of the topic).
Tuple Fields§
§0: MessageIdIdentifier of the root message in a reply thread.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ThreadId
impl<'de> Deserialize<'de> for ThreadId
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ThreadId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ThreadId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for ThreadId
impl Serialize for ThreadId
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,
impl Copy for ThreadId
impl Eq for ThreadId
impl StructuralPartialEq for ThreadId
Auto Trait Implementations§
impl Freeze for ThreadId
impl RefUnwindSafe for ThreadId
impl Send for ThreadId
impl Sync for ThreadId
impl Unpin for ThreadId
impl UnwindSafe for ThreadId
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<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.Source§impl<T> Erasable for T
impl<T> Erasable for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.