Struct Indications
pub struct Indications<T> {
receiver: Receiver<Message>,
indication: PhantomData<fn() -> T>,
}Expand description
Indications of one type that a client receives.
Returned by Client::indications. Each
receiver buffers indications on its own, see
ClientBuilder::indication_capacity.
Fields§
§receiver: Receiver<Message>§indication: PhantomData<fn() -> T>Implementations§
§impl<T: Indication> Indications<T>
impl<T: Indication> Indications<T>
pub(super) const fn new(receiver: Receiver<Message>) -> Self
pub async fn next(&mut self) -> Result<T, Error>
pub async fn next(&mut self) -> Result<T, Error>
Waits for the next indication of type T.
Indications with other message IDs are skipped.
§Errors
Error::Laggedif indications were dropped because the buffer was full. The next call continues with the oldest buffered indication.Error::Disconnectedonce the connection has stopped and every buffered indication was returned.Error::Decodeif a matching indication is invalid. The next call continues with the following indication.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Indications<T>
impl<T> RefUnwindSafe for Indications<T>
impl<T> Send for Indications<T>
impl<T> Sync for Indications<T>
impl<T> Unpin for Indications<T>
impl<T> UnsafeUnpin for Indications<T>
impl<T> UnwindSafe for Indications<T>
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
Mutably borrows from an owned value. Read more