pub struct Monitor<Time = MonotonicInstant> { /* private fields */ }
Expand description
Monitor
monitors the reachability state.
Implementations§
Source§impl<Time: TimeProvider + Default> Monitor<Time>
impl<Time: TimeProvider + Default> Monitor<Time>
Sourcepub fn new(
network_check_sender: UnboundedSender<(NetworkCheckAction, NetworkCheckCookie)>,
) -> Result<Self>
pub fn new( network_check_sender: UnboundedSender<(NetworkCheckAction, NetworkCheckCookie)>, ) -> Result<Self>
Create the monitoring service.
Source§impl<Time> Monitor<Time>
impl<Time> Monitor<Time>
Sourcepub fn new_with_time_provider(
network_check_sender: UnboundedSender<(NetworkCheckAction, NetworkCheckCookie)>,
time_provider: Time,
) -> Result<Self>
pub fn new_with_time_provider( network_check_sender: UnboundedSender<(NetworkCheckAction, NetworkCheckCookie)>, time_provider: Time, ) -> Result<Self>
Create the monitoring service.
Source§impl<Time: TimeProvider> Monitor<Time>
impl<Time: TimeProvider> Monitor<Time>
pub fn state(&self) -> &StateInfo
Sourcepub fn report_state(&self)
pub fn report_state(&self)
Reports all information.
Sourcepub fn set_inspector(&mut self, inspector: &'static Inspector)
pub fn set_inspector(&mut self, inspector: &'static Inspector)
Sets the inspector.
pub fn set_telemetry_sender(&mut self, telemetry_sender: TelemetrySender)
Sourcepub fn handle_interface_removed(&mut self, _: Properties<DefaultInterest>)
pub fn handle_interface_removed(&mut self, _: Properties<DefaultInterest>)
Handle an interface removed event.
Trait Implementations§
Source§impl<Time: TimeProvider> NetworkChecker for Monitor<Time>
impl<Time: TimeProvider> NetworkChecker for Monitor<Time>
Source§fn begin(
&mut self,
_: InterfaceView<'_>,
) -> Result<NetworkCheckerOutcome, Error>
fn begin( &mut self, _: InterfaceView<'_>, ) -> Result<NetworkCheckerOutcome, Error>
begin
starts a re-entrant, asynchronous network check on the supplied interface. It
returns whether the network check was completed, must be resumed, or if the supplied
interface already had an ongoing network check.Source§fn resume(
&mut self,
cookie: NetworkCheckCookie,
result: NetworkCheckResult,
) -> Result<NetworkCheckerOutcome, Error>
fn resume( &mut self, cookie: NetworkCheckCookie, result: NetworkCheckResult, ) -> Result<NetworkCheckerOutcome, Error>
resume
continues a network check that was not yet completed.Auto Trait Implementations§
impl<Time> Freeze for Monitor<Time>where
Time: Freeze,
impl<Time = MonotonicInstant> !RefUnwindSafe for Monitor<Time>
impl<Time> Send for Monitor<Time>where
Time: Send,
impl<Time> Sync for Monitor<Time>where
Time: Sync,
impl<Time> Unpin for Monitor<Time>where
Time: Unpin,
impl<Time = MonotonicInstant> !UnwindSafe for Monitor<Time>
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