pub struct Subscriber<S, O, F: Fn(&S, O) -> bool> { /* private fields */ }
Expand description
A Subscriber
can be used to register observation requests with the HangingGet
.
These will be notified when the state changes or immediately the first time
a Subscriber
registers an observation.
§Type parameters
See HangingGet for the explanation of the type parameters S
, O
, F
.
Implementations§
Source§impl<S, O, F> Subscriber<S, O, F>
impl<S, O, F> Subscriber<S, O, F>
Sourcepub fn register(&self, observation: O) -> Result<(), HangingGetServerError>
pub fn register(&self, observation: O) -> Result<(), HangingGetServerError>
Register a new observation.
Errors occur when:
- A Subscriber attempts to register an observation when there is already an outstanding observation waiting on updates.
Auto Trait Implementations§
impl<S, O, F> Freeze for Subscriber<S, O, F>
impl<S, O, F> !RefUnwindSafe for Subscriber<S, O, F>
impl<S, O, F> Send for Subscriber<S, O, F>
impl<S, O, F> Sync for Subscriber<S, O, F>
impl<S, O, F> Unpin for Subscriber<S, O, F>
impl<S, O, F> !UnwindSafe for Subscriber<S, O, F>
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