pub struct LatestEvents { /* private fields */ }Expand description
The entry point to fetch the LatestEventValue for rooms or threads.
Implementations§
Source§impl LatestEvents
impl LatestEvents
Sourcepub async fn listen_to_room(
&self,
room_id: &RoomId,
) -> Result<bool, LatestEventsError>
pub async fn listen_to_room( &self, room_id: &RoomId, ) -> Result<bool, LatestEventsError>
Start listening to updates (if not already) for a particular room.
It returns true if the room exists, false otherwise.
Sourcepub async fn listen_and_subscribe_to_room(
&self,
room_id: &RoomId,
) -> Result<Option<Subscriber<LatestEventValue, AsyncLock>>, LatestEventsError>
pub async fn listen_and_subscribe_to_room( &self, room_id: &RoomId, ) -> Result<Option<Subscriber<LatestEventValue, AsyncLock>>, LatestEventsError>
Start listening to updates (if not already) for a particular room, and
return a Subscriber to get the current and future
LatestEventValues.
It returns Some if the room exists, None otherwise.
Sourcepub async fn listen_to_thread(
&self,
room_id: &RoomId,
thread_id: &EventId,
) -> Result<bool, LatestEventsError>
pub async fn listen_to_thread( &self, room_id: &RoomId, thread_id: &EventId, ) -> Result<bool, LatestEventsError>
Start listening to updates (if not already) for a particular room and a particular thread in this room.
It returns true if the room and the thread exists, false otherwise.
Sourcepub async fn listen_and_subscribe_to_thread(
&self,
room_id: &RoomId,
thread_id: &EventId,
) -> Result<Option<Subscriber<LatestEventValue, AsyncLock>>, LatestEventsError>
pub async fn listen_and_subscribe_to_thread( &self, room_id: &RoomId, thread_id: &EventId, ) -> Result<Option<Subscriber<LatestEventValue, AsyncLock>>, LatestEventsError>
Start listening to updates (if not already) for a particular room and a
particular thread in this room, and return a Subscriber to get the
current and future LatestEventValues.
It returns Some if the room and the thread exists, None otherwise.
Sourcepub async fn forget_room(&self, room_id: &RoomId)
pub async fn forget_room(&self, room_id: &RoomId)
Forget a room.
It means that LatestEvents will stop listening to updates for the
LatestEvents of the room and all its threads.
If LatestEvents is not listening for room_id, nothing happens.
Sourcepub async fn forget_thread(&self, room_id: &RoomId, thread_id: &EventId)
pub async fn forget_thread(&self, room_id: &RoomId, thread_id: &EventId)
Forget a thread.
It means that LatestEvents will stop listening to updates for the
LatestEvent of the thread.
If LatestEvents is not listening for room_id or thread_id,
nothing happens.
Trait Implementations§
Source§impl Clone for LatestEvents
impl Clone for LatestEvents
Source§fn clone(&self) -> LatestEvents
fn clone(&self) -> LatestEvents
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for LatestEvents
impl !RefUnwindSafe for LatestEvents
impl Send for LatestEvents
impl Sync for LatestEvents
impl Unpin for LatestEvents
impl !UnwindSafe for LatestEvents
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> 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, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
Source§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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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