Struct bxcan::Frame [−][src]
A CAN data or remote frame.
Implementations
impl Frame
[src]
pub fn new_data(id: impl Into<Id>, data: impl Into<Data>) -> Self
[src]
Creates a new data frame.
pub fn new_remote(id: impl Into<Id>, dlc: u8) -> Self
[src]
Creates a new remote frame with configurable data length code (DLC).
Panics
This function will panic if dlc
is not inside the valid range 0..=8
.
pub fn is_extended(&self) -> bool
[src]
Returns true if this frame is an extended frame.
pub fn is_standard(&self) -> bool
[src]
Returns true if this frame is a standard frame.
pub fn is_remote_frame(&self) -> bool
[src]
Returns true if this frame is a remote frame.
pub fn is_data_frame(&self) -> bool
[src]
Returns true if this frame is a data frame.
pub fn id(&self) -> Id
[src]
Returns the frame identifier.
pub fn priority(&self) -> FramePriority
[src]
Returns the priority of this frame.
pub fn dlc(&self) -> u8
[src]
Returns the data length code (DLC) which is in the range 0..8.
For data frames the DLC value always matches the length of the data. Remote frames do not carry any data, yet the DLC can be greater than 0.
pub fn data(&self) -> Option<&Data>
[src]
Returns the frame data (0..8 bytes in length) if this is a data frame.
If this is a remote frame, returns None
.
Trait Implementations
impl Clone for Frame
[src]
fn clone(&self) -> Frame
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Frame
[src]
impl Eq for Frame
[src]
impl Format for Frame
[src]
impl Frame for Frame
[src]
fn new(id: impl Into<Id>, data: &[u8]) -> Result<Self, ()>
[src]
fn new_remote(id: impl Into<Id>, dlc: usize) -> Result<Self, ()>
[src]
fn is_extended(&self) -> bool
[src]
fn is_standard(&self) -> bool
[src]
fn is_remote_frame(&self) -> bool
[src]
fn is_data_frame(&self) -> bool
[src]
fn id(&self) -> Id
[src]
fn dlc(&self) -> usize
[src]
fn data(&self) -> &[u8]
[src]
impl PartialEq<Frame> for Frame
[src]
impl StructuralEq for Frame
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,