pub struct ThreadEventCache { /* private fields */ }Expand description
All the information related to a single thread.
Cloning is shallow, and thus is cheap to do.
Implementations§
Source§impl ThreadEventCache
impl ThreadEventCache
Sourcepub async fn num_unread_messages(&self) -> Result<u64>
pub async fn num_unread_messages(&self) -> Result<u64>
Get the number of unread messages.
To get multiple information about the read receipts, use
Self::read_receipts as it involves a single lock.
Sourcepub async fn num_unread_notifications(&self) -> Result<u64>
pub async fn num_unread_notifications(&self) -> Result<u64>
Get the number of unread notifications.
To get multiple information about the read receipts, use
Self::read_receipts as it involves a single lock.
Sourcepub async fn num_unread_mentions(&self) -> Result<u64>
pub async fn num_unread_mentions(&self) -> Result<u64>
Get the number of unread mentions, that is, messages causing a highlight in a room.
To get multiple information about the read receipts, use
Self::read_receipts as it involves a single lock.
Sourcepub async fn read_receipts(&self) -> Result<ReadReceipts>
pub async fn read_receipts(&self) -> Result<ReadReceipts>
Get the detailed information about read receipts for this thread.
Sourcepub async fn subscribe_to_thread_info(
&self,
) -> Result<Subscriber<ThreadInfo, AsyncLock>>
pub async fn subscribe_to_thread_info( &self, ) -> Result<Subscriber<ThreadInfo, AsyncLock>>
Subscribe to update of the ThreadInfo.
Sourcepub async fn subscribe(
&self,
) -> Result<(Vec<Event>, Subscriber<ThreadEventCacheUpdate>)>
pub async fn subscribe( &self, ) -> Result<(Vec<Event>, Subscriber<ThreadEventCacheUpdate>)>
Subscribe to this thread updates, after getting the initial list of events.
Creating, and especially dropping, a Subscriber isn’t free, as it
triggers side-effects.
Sourcepub fn pagination(&self) -> ThreadPagination
pub fn pagination(&self) -> ThreadPagination
Return a ThreadPagination useful for running back-pagination queries
in this thread.
Sourcepub async fn find_event_with_relations(
&self,
event_id: &EventId,
filter: Option<Vec<RelationType>>,
) -> Result<Option<(Event, Vec<Event>)>>
pub async fn find_event_with_relations( &self, event_id: &EventId, filter: Option<Vec<RelationType>>, ) -> Result<Option<(Event, Vec<Event>)>>
Try to find an event by ID in this thread, along with its related events.
You can filter which types of related events to retrieve using
filter. None will retrieve related events of any type.
The related events are sorted like this:
- events saved out-of-band (with
RoomEventCache::save_events) will be located at the beginning of the array. - events present in the linked chunk (be it in memory or in the storage) will be sorted according to their ordering in the linked chunk.
Trait Implementations§
Source§impl Clone for ThreadEventCache
impl Clone for ThreadEventCache
Source§fn clone(&self) -> ThreadEventCache
fn clone(&self) -> ThreadEventCache
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ThreadEventCache
impl !UnwindSafe for ThreadEventCache
impl Freeze for ThreadEventCache
impl Send for ThreadEventCache
impl Sync for ThreadEventCache
impl Unpin for ThreadEventCache
impl UnsafeUnpin for ThreadEventCache
Blanket Implementations§
impl<T> Any for Twhere
T: Any,
impl<T> AsyncTraitDeps for T
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
impl<T> CloneAny for T
impl<T> CloneAnySend for T
impl<T> CloneAnySendSync for T
impl<T> CloneAnySync for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> Fruit for T
§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 moreSource§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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 more