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
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
Converts the given service transport handle of type
T
to [Self
]§impl<T> IntoAny for T
impl<T> IntoAny for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
Source§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
Source§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.