pub struct Subscriber<O> { /* private fields */ }
Expand description
A Subscriber
can be used to register observation requests with the HangingGetBroker
.
These observations will be fulfilled when the state changes or immediately the first time
a Subscriber
registers an observation.
Implementations§
Source§impl<O> Subscriber<O>
impl<O> Subscriber<O>
Sourcepub async fn register(
&mut self,
observation: O,
) -> Result<(), HangingGetServerError>
pub async fn register( &mut self, observation: O, ) -> Result<(), HangingGetServerError>
Register a new observation. Errors occur when:
- A
Subscriber
is sending observation requests at too high a rate. - The
HangingGetBroker
has been dropped by the server.
Trait Implementations§
Source§impl<O> From<Sender<O, Result<(), HangingGetServerError>>> for Subscriber<O>
impl<O> From<Sender<O, Result<(), HangingGetServerError>>> for Subscriber<O>
Auto Trait Implementations§
impl<O> Freeze for Subscriber<O>
impl<O> !RefUnwindSafe for Subscriber<O>
impl<O> Send for Subscriber<O>where
O: Send,
impl<O> Sync for Subscriber<O>where
O: Send,
impl<O> Unpin for Subscriber<O>
impl<O> !UnwindSafe for Subscriber<O>
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