Struct matrix_sdk::send_queue::RoomSendQueue
source · pub struct RoomSendQueue { /* private fields */ }
Expand description
A per-room send queue.
This is cheap to clone.
Implementations§
source§impl RoomSendQueue
impl RoomSendQueue
sourcepub async fn send_raw(
&self,
content: Raw<AnyMessageLikeEventContent>,
event_type: String,
) -> Result<SendHandle, RoomSendQueueError>
pub async fn send_raw( &self, content: Raw<AnyMessageLikeEventContent>, event_type: String, ) -> Result<SendHandle, RoomSendQueueError>
Queues a raw event for sending it to this room.
This immediately returns, and will push the event to be sent into a queue, handled in the background.
Callers are expected to consume RoomSendQueueUpdate
via calling
the Self::subscribe()
method to get updates about the sending of
that event.
By default, if sending failed on the first attempt, it will be retried a few times. If sending failed after those retries, the entire client’s sending queue will be disabled, and it will need to be manually re-enabled by the caller (e.g. after network is back, or when something has been done about the faulty requests).
sourcepub async fn send(
&self,
content: AnyMessageLikeEventContent,
) -> Result<SendHandle, RoomSendQueueError>
pub async fn send( &self, content: AnyMessageLikeEventContent, ) -> Result<SendHandle, RoomSendQueueError>
Queues an event for sending it to this room.
This immediately returns, and will push the event to be sent into a queue, handled in the background.
Callers are expected to consume RoomSendQueueUpdate
via calling
the Self::subscribe()
method to get updates about the sending of
that event.
By default, if sending failed on the first attempt, it will be retried a few times. If sending failed after those retries, the entire client’s sending queue will be disabled, and it will need to be manually re-enabled by the caller (e.g. after network is back, or when something has been done about the faulty requests).
sourcepub async fn subscribe(
&self,
) -> Result<(Vec<LocalEcho>, Receiver<RoomSendQueueUpdate>), RoomSendQueueError>
pub async fn subscribe( &self, ) -> Result<(Vec<LocalEcho>, Receiver<RoomSendQueueUpdate>), RoomSendQueueError>
Returns the current local requests as well as a receiver to listen to
the send queue updates, as defined in RoomSendQueueUpdate
.
sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Returns whether the room is enabled, at the room level.
sourcepub fn set_enabled(&self, enabled: bool)
pub fn set_enabled(&self, enabled: bool)
Set the locally enabled flag for this room queue.
sourcepub async fn unwedge(
&self,
transaction_id: &TransactionId,
) -> Result<(), RoomSendQueueError>
pub async fn unwedge( &self, transaction_id: &TransactionId, ) -> Result<(), RoomSendQueueError>
Unwedge a local echo identified by its transaction identifier and try to resend it.
Trait Implementations§
source§impl Clone for RoomSendQueue
impl Clone for RoomSendQueue
source§fn clone(&self) -> RoomSendQueue
fn clone(&self) -> RoomSendQueue
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 RoomSendQueue
impl !RefUnwindSafe for RoomSendQueue
impl Send for RoomSendQueue
impl Sync for RoomSendQueue
impl Unpin for RoomSendQueue
impl !UnwindSafe for RoomSendQueue
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<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