pub struct Publisher<S, O, F: Fn(&S, O) -> bool> { /* private fields */ }
Expand description
A Publisher
is used to make changes to the state contained within a HangingGet
.
It is designed to be cheaply cloned and Send
.
§Type parameters
See HangingGet for the explanation of the generic types S
, O
, F
.
Implementations§
Source§impl<S, O, F> Publisher<S, O, F>
impl<S, O, F> Publisher<S, O, F>
Sourcepub fn update<UpdateFn>(&self, update: UpdateFn)
pub fn update<UpdateFn>(&self, update: UpdateFn)
Pass a function to the hanging get that can update the hanging get state in place.
Any subscriber that has registered an observer will immediately be notified of the update.
§Type parameters
UpdateFn
: an update function: gets passed the new state, and returnstrue
if the state has been updated with success.
Trait Implementations§
Auto Trait Implementations§
impl<S, O, F> Freeze for Publisher<S, O, F>
impl<S, O, F> !RefUnwindSafe for Publisher<S, O, F>
impl<S, O, F> Send for Publisher<S, O, F>
impl<S, O, F> Sync for Publisher<S, O, F>
impl<S, O, F> Unpin for Publisher<S, O, F>
impl<S, O, F> !UnwindSafe for Publisher<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)