pub struct PubSubHub { /* private fields */ }
Expand description
A rendezvous point for publishers and subscribers.
Implementations§
Source§impl PubSubHub
impl PubSubHub
pub fn new(storage_path: PathBuf) -> Self
Sourcepub fn publish<S>(&self, new_value: S)
pub fn publish<S>(&self, new_value: S)
Publishes new_value
.
- All pending futures are woken.
- Later calls to
watch_for_change()
will be evaluated againstnew_value
.
Sourcepub fn watch_for_change<S>(&self, last_value: Option<S>) -> PubSubFuture<'_> ⓘ
pub fn watch_for_change<S>(&self, last_value: Option<S>) -> PubSubFuture<'_> ⓘ
Watches the value stored in this hub, resolving when the
stored value differs from last_value
.
pub fn get_value(&self) -> Option<String>
Auto Trait Implementations§
impl !Freeze for PubSubHub
impl !RefUnwindSafe for PubSubHub
impl Send for PubSubHub
impl !Sync for PubSubHub
impl Unpin for PubSubHub
impl UnwindSafe for PubSubHub
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