pub struct ConnectionMonitor { /* private fields */ }Expand description
Connection health monitor
Tracks the time since last feedback was received from the robot.
Implementations§
Source§impl ConnectionMonitor
impl ConnectionMonitor
Sourcepub fn check_connection(&self) -> bool
pub fn check_connection(&self) -> bool
Check if connection is still alive
Returns true if feedback received within timeout window
Sourcepub fn register_feedback(&self)
pub fn register_feedback(&self)
Register that we received feedback from the robot
Call this after processing each CAN frame to update the last feedback time.
Sourcepub fn time_since_last_feedback(&self) -> Duration
pub fn time_since_last_feedback(&self) -> Duration
Get time since last feedback
Auto Trait Implementations§
impl !Freeze for ConnectionMonitor
impl RefUnwindSafe for ConnectionMonitor
impl Send for ConnectionMonitor
impl Sync for ConnectionMonitor
impl Unpin for ConnectionMonitor
impl UnwindSafe for ConnectionMonitor
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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