pub struct LinkStatus { /* private fields */ }Expand description
The LinkStatus can be used inside the nodes to keep track of the link status It embeds a protobuf LinkStatus message which is cloned each time has to be sent out The data_in and data_out functions can be called when new data is received or sent One of the change_state, state_ok, state_failed functions can be called when the link goes up or down. From time to time the send() can be called to send the data to Yamcs.
Implementations§
Source§impl LinkStatus
impl LinkStatus
pub fn new(addr: Addr) -> Self
Sourcepub fn change_state(&mut self, state: i32, err: Option<String>)
pub fn change_state(&mut self, state: i32, err: Option<String>)
change the state
Sourcepub fn state_failed(&mut self, msg: String)
pub fn state_failed(&mut self, msg: String)
set the state to failed with the given message
Sourcepub async fn send(&self, tx: &Sender<YgwMessage>) -> Result<()>
pub async fn send(&self, tx: &Sender<YgwMessage>) -> Result<()>
send the status over the channel
Sourcepub fn blocking_send(&self, tx: &Sender<YgwMessage>) -> Result<()>
pub fn blocking_send(&self, tx: &Sender<YgwMessage>) -> Result<()>
send the status over the channel
pub fn addr(&self) -> Addr
pub fn data_in_count(&self) -> u64
pub fn data_out_count(&self) -> u64
Auto Trait Implementations§
impl Freeze for LinkStatus
impl RefUnwindSafe for LinkStatus
impl Send for LinkStatus
impl Sync for LinkStatus
impl Unpin for LinkStatus
impl UnwindSafe for LinkStatus
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