pub struct Hub<T: TransportPort + 'static> { /* private fields */ }Expand description
The watch hub over one engine. Cheap to clone: clones share one hub.
Implementations§
Source§impl<T: TransportPort + 'static> Hub<T>
impl<T: TransportPort + 'static> Hub<T>
Sourcepub fn new(
engine: Arc<Engine<T>>,
options: WatchOptions,
) -> Result<Self, String>
pub fn new( engine: Arc<Engine<T>>, options: WatchOptions, ) -> Result<Self, String>
A hub over engine, under checked options. It starts its
notification receiver, so it must be made inside a Tokio runtime.
Sourcepub fn options(&self) -> &WatchOptions
pub fn options(&self) -> &WatchOptions
The hub’s settings.
Sourcepub fn watch(&self, point: Point) -> Result<Lease, WatchError>
pub fn watch(&self, point: Point) -> Result<Lease, WatchError>
A lease on point, starting its watch if it has none. A new
watch goes to its device’s scheduler, started with it when the
device has none.
Sourcepub fn peek(&self, point: &Point) -> Option<Snapshot>
pub fn peek(&self, point: &Point) -> Option<Snapshot>
point’s latest values, if it is watched: nothing is sent.
Sourcepub fn seq(&self) -> u64
pub fn seq(&self) -> u64
The hub’s sequence number: every change takes the next one, so a
point changed since an earlier reading of this when its
Snapshot::seq is greater.
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Hub<T>
impl<T> !UnwindSafe for Hub<T>
impl<T> Freeze for Hub<T>
impl<T> Send for Hub<T>
impl<T> Sync for Hub<T>
impl<T> Unpin for Hub<T>
impl<T> UnsafeUnpin for Hub<T>where
Arc<Inner<T>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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