BusController

Struct BusController 

Source
pub struct BusController {
    pub bus: Bus,
    pub response_timeout: Duration,
    /* private fields */
}
Expand description

Bus Controller state and management

Fields§

§bus: Bus

Bus identifier

§response_timeout: Duration

Expected response timeout

Implementations§

Source§

impl BusController

Source

pub fn new(bus: Bus) -> Self

Create a new Bus Controller for a bus

Source

pub fn register_rt(&mut self, address: Address) -> Result<()>

Register a Remote Terminal

Source

pub fn register_rts(&mut self, addresses: &[u8]) -> Result<()>

Register multiple Remote Terminals

Source

pub fn get_rt(&self, address: Address) -> Option<&RemoteTerminal>

Get Remote Terminal info

Source

pub fn get_rt_mut(&mut self, address: Address) -> Option<&mut RemoteTerminal>

Get mutable Remote Terminal info

Source

pub fn list_rts(&self) -> Vec<&RemoteTerminal>

List all registered Remote Terminals

Source

pub fn get_responding_rts(&self) -> Vec<&RemoteTerminal>

Get all responding Remote Terminals

Source

pub fn rt_count(&self) -> usize

Get total number of RTs

Source

pub fn record_rt_success(&mut self, address: Address) -> Result<()>

Record a successful transaction with an RT

Source

pub fn record_rt_error(&mut self, address: Address) -> Result<()>

Record a failed transaction with an RT

Source

pub fn get_rt_stats(&self, address: Address) -> Option<RTStats>

Get statistics for a Remote Terminal

Source

pub fn get_all_stats(&self) -> Vec<RTStats>

Get statistics for all Remote Terminals

Trait Implementations§

Source§

impl Debug for BusController

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.