mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-06 15:04:11 -04:00
doc(sdk): Specify how the Client::observe_events works.
This commit is contained in:
@@ -807,6 +807,10 @@ impl Client {
|
||||
/// implements a [`Stream`]. The `Stream::Item` will be of type `(Ev,
|
||||
/// Ctx)`.
|
||||
///
|
||||
/// Be careful that only the most recent value can be observed. Subscribers
|
||||
/// are notified when a new value is sent, but there is no guarantee
|
||||
/// that they will see all values.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// Let's see a classical usage:
|
||||
@@ -879,6 +883,10 @@ impl Client {
|
||||
/// This method works the same way as [`Client::observe_events`], except
|
||||
/// that the observability will only be applied for events in the room with
|
||||
/// the specified ID. See that method for more details.
|
||||
///
|
||||
/// Be careful that only the most recent value can be observed. Subscribers
|
||||
/// are notified when a new value is sent, but there is no guarantee
|
||||
/// that they will see all values.
|
||||
pub fn observe_room_events<Ev, Ctx>(
|
||||
&self,
|
||||
room_id: &RoomId,
|
||||
|
||||
@@ -541,6 +541,9 @@ impl_event_handler!(A, B, C, D, E, F, G, H);
|
||||
|
||||
/// An observer of events (may be tailored to a room).
|
||||
///
|
||||
/// Only the most recent value can be observed. Subscribers are notified when a
|
||||
/// new value is sent, but there is no guarantee that they will see all values.
|
||||
///
|
||||
/// To create such observer, use [`Client::observe_events`] or
|
||||
/// [`Client::observe_room_events`].
|
||||
#[derive(Debug)]
|
||||
|
||||
Reference in New Issue
Block a user