Encode

Trait Encode 

Source
pub trait Encode<T>: TryEncode<T> {
    // Provided method
    fn encode<D: CANWrite>(&self, data: &mut D, value: T) { ... }
}
Expand description

A trait modeling the not failable encoding of data.

Encode is sub-trait of TryEncode. encode is implemented using try_encode. If try_encode succeeds, encode returns. Otherwise, encode panics.

Provided Methods§

Source

fn encode<D: CANWrite>(&self, data: &mut D, value: T)

Encodes value into the CAN-bus data data.

§Panics

encode panics if the call to try_encode in the implementation returns the error variant.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§