pub struct Bus { /* private fields */ }Expand description
One CAN interface plus the vendor codec attached to it.
One Bus instance per physical interface; the codec is shared across
every group attached to the bus, so inbound frames are decoded exactly
once per frame.
Implementations§
Source§impl Bus
impl Bus
Sourcepub fn new(transport: Box<dyn CanBus>, codec: Box<dyn MotorCodec>) -> Self
pub fn new(transport: Box<dyn CanBus>, codec: Box<dyn MotorCodec>) -> Self
Construct a bus and invoke codec.bind_to_bus(transport.capabilities())
exactly once.
Sourcepub fn capabilities(&self) -> BusCapabilities
pub fn capabilities(&self) -> BusCapabilities
Capabilities reported by the underlying transport.
Sourcepub fn codec_supports(&self, mt: MotorTypeId) -> bool
pub fn codec_supports(&self, mt: MotorTypeId) -> bool
True iff the bus’s codec can encode/decode this motor type.
Auto Trait Implementations§
impl Freeze for Bus
impl !RefUnwindSafe for Bus
impl Send for Bus
impl !Sync for Bus
impl Unpin for Bus
impl UnsafeUnpin for Bus
impl !UnwindSafe for Bus
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