Struct reachability_core::Monitor
source · pub struct Monitor<Time = MonotonicTime> { /* 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)
pub fn handle_interface_removed(&mut self, _: Properties)
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 = MonotonicTime> !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 = MonotonicTime> !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
§impl<T> Encode<Ambiguous1> for T
impl<T> Encode<Ambiguous1> for T
§impl<T> Encode<Ambiguous2> for T
impl<T> Encode<Ambiguous2> for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoAny for T
impl<T> IntoAny for T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
type Error = <U as TryFromExt<T>>::Error
§fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
Tries to perform the conversion.