pub struct NetStatusClient { /* private fields */ }Expand description
An independent view of the engine’s shared network monitor. Clones share this view’s lifecycle; other named views remain independent.
Implementations§
Source§impl NetStatusClient
impl NetStatusClient
Sourcepub async fn start(&self) -> Result<NetworkSnapshot>
pub async fn start(&self) -> Result<NetworkSnapshot>
Start monitoring and await the first coherent observation. Repeated calls share the active monitor and its initialization result.
Sourcepub async fn stop(&self) -> Result<()>
pub async fn stop(&self) -> Result<()>
Stop monitoring while keeping subscriptions alive for a later restart.
Sourcepub async fn shutdown(&self) -> Result<()>
pub async fn shutdown(&self) -> Result<()>
Permanently close monitoring and publish its final Closed snapshot.
Sourcepub fn snapshot(&self) -> Result<NetworkSnapshot>
pub fn snapshot(&self) -> Result<NetworkSnapshot>
Read the latest coherent snapshot, including an inactive or final state.
Sourcepub fn subscribe(&self) -> Result<StateReceiver<NetworkSnapshot>>
pub fn subscribe(&self) -> Result<StateReceiver<NetworkSnapshot>>
Subscribe to the current snapshot and later changes across stop/restart.
Sourcepub fn on_change<F>(&self, callback: F) -> Result<Subscription>
pub fn on_change<F>(&self, callback: F) -> Result<Subscription>
Observe the same snapshots as an asynchronous subscription on the shared callback pool. Keep the returned owner alive while observing changes.
Trait Implementations§
Source§impl Clone for NetStatusClient
impl Clone for NetStatusClient
Auto Trait Implementations§
impl !RefUnwindSafe for NetStatusClient
impl !UnwindSafe for NetStatusClient
impl Freeze for NetStatusClient
impl Send for NetStatusClient
impl Sync for NetStatusClient
impl Unpin for NetStatusClient
impl UnsafeUnpin for NetStatusClient
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