[][src]Struct bxcan::Data

pub struct Data { /* fields omitted */ }

Payload of a CAN data frame.

Contains 0 to 8 Bytes of data.

Data implements From<[u8; N]> for all N up to 8, which provides a convenient lossless conversion from fixed-length arrays.

Implementations

impl Data[src]

pub fn new(data: &[u8]) -> Option<Self>[src]

Creates a data payload from a raw byte slice.

Returns None if data contains more than 8 Bytes (which is the maximum).

Data can also be constructed from fixed-length arrays up to length 8 via From/Into.

pub const fn empty() -> Self[src]

Creates an empty data payload containing 0 bytes.

Trait Implementations

impl AsMut<[u8]> for Data[src]

impl AsRef<[u8]> for Data[src]

impl Clone for Data[src]

impl Copy for Data[src]

impl Debug for Data[src]

impl Deref for Data[src]

type Target = [u8]

The resulting type after dereferencing.

impl DerefMut for Data[src]

impl Eq for Data[src]

impl Format for Data[src]

impl From<[u8; 0]> for Data[src]

impl From<[u8; 1]> for Data[src]

impl From<[u8; 2]> for Data[src]

impl From<[u8; 3]> for Data[src]

impl From<[u8; 4]> for Data[src]

impl From<[u8; 5]> for Data[src]

impl From<[u8; 6]> for Data[src]

impl From<[u8; 7]> for Data[src]

impl From<[u8; 8]> for Data[src]

impl PartialEq<Data> for Data[src]

Auto Trait Implementations

impl RefUnwindSafe for Data

impl Send for Data

impl Sync for Data

impl Unpin for Data

impl UnwindSafe for Data

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.