CanFrame

Trait CanFrame 

Source
pub trait CanFrame: Send + Sync {
    type Channel: Display;

Show 22 methods // Required methods fn new(id: impl Into<Id>, data: &[u8]) -> Option<Self> where Self: Sized; fn new_remote(id: impl Into<Id>, len: usize) -> Option<Self> where Self: Sized; fn timestamp(&self) -> u64; fn set_timestamp(&mut self, value: Option<u64>) -> &mut Self where Self: Sized; fn id(&self) -> Id; fn can_type(&self) -> Type; fn set_can_type(&mut self, type: Type) -> &mut Self where Self: Sized; fn is_remote(&self) -> bool; fn is_extended(&self) -> bool; fn direct(&self) -> Direct; fn set_direct(&mut self, direct: Direct) -> &mut Self where Self: Sized; fn is_bitrate_switch(&self) -> bool; fn set_bitrate_switch(&mut self, value: bool) -> &mut Self where Self: Sized; fn is_error_frame(&self) -> bool; fn set_error_frame(&mut self, value: bool) -> &mut Self where Self: Sized; fn is_esi(&self) -> bool; fn set_esi(&mut self, value: bool) -> &mut Self where Self: Sized; fn channel(&self) -> Self::Channel; fn set_channel(&mut self, value: Self::Channel) -> &mut Self where Self: Sized; fn data(&self) -> &[u8] ; fn length(&self) -> usize; // Provided method fn dlc(&self) -> isize { ... }
}
Expand description

CAN 2.0 | CAN 1.0

Required Associated Types§

Required Methods§

Source

fn new(id: impl Into<Id>, data: &[u8]) -> Option<Self>
where Self: Sized,

Source

fn new_remote(id: impl Into<Id>, len: usize) -> Option<Self>
where Self: Sized,

Source

fn timestamp(&self) -> u64

Source

fn set_timestamp(&mut self, value: Option<u64>) -> &mut Self
where Self: Sized,

Source

fn id(&self) -> Id

Prioritizes returning J1939Id if j1939 is true.

Source

fn can_type(&self) -> Type

Source

fn set_can_type(&mut self, type: Type) -> &mut Self
where Self: Sized,

Source

fn is_remote(&self) -> bool

Source

fn is_extended(&self) -> bool

Source

fn direct(&self) -> Direct

Source

fn set_direct(&mut self, direct: Direct) -> &mut Self
where Self: Sized,

Source

fn is_bitrate_switch(&self) -> bool

Source

fn set_bitrate_switch(&mut self, value: bool) -> &mut Self
where Self: Sized,

Source

fn is_error_frame(&self) -> bool

Source

fn set_error_frame(&mut self, value: bool) -> &mut Self
where Self: Sized,

Source

fn is_esi(&self) -> bool

Error state indicator

Source

fn set_esi(&mut self, value: bool) -> &mut Self
where Self: Sized,

Set error state indicator

Source

fn channel(&self) -> Self::Channel

Source

fn set_channel(&mut self, value: Self::Channel) -> &mut Self
where Self: Sized,

Source

fn data(&self) -> &[u8]

ensure return the actual length of data.

Source

fn length(&self) -> usize

Provided Methods§

Source

fn dlc(&self) -> isize

Trait Implementations§

Source§

impl<T: Display> Display for dyn Frame<Channel = T>

Source§

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

Output Frame as asc String.

Implementors§