Skip to main content

CopyEncoder

Struct CopyEncoder 

Source
pub struct CopyEncoder { /* private fields */ }
Expand description

A copy encoder copies the provided symbols from the user space into the driver layer.

It is usually used to encode non-mut data, i.e. data that does not change at runtime after initialization, such as the leading code in the IR protocol.

For custom Encoder this type is essential to copy the generated symbols into the RMT driver.

Implementations§

Source§

impl CopyEncoder

Source

pub fn new() -> Result<Self, EspError>

Constructs a new copy encoder with default configuration.

Source

pub fn with_config(config: &rmt_copy_encoder_config_t) -> Result<Self, EspError>

Constructs a new copy encoder with the provided configuration.

Trait Implementations§

Source§

impl Debug for CopyEncoder

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Drop for CopyEncoder

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl RawEncoder for CopyEncoder

Source§

type Item = Symbol

The type of input data the encoder can encode.
Source§

fn handle(&mut self) -> &mut rmt_encoder_t

Returns a mutable reference to the underlying rmt_encoder_t. Read more
Source§

fn reset(&mut self) -> Result<(), EspError>

Reset the encoder state. Read more

Auto Trait Implementations§

§

impl Freeze for CopyEncoder

§

impl RefUnwindSafe for CopyEncoder

§

impl !Send for CopyEncoder

§

impl !Sync for CopyEncoder

§

impl Unpin for CopyEncoder

§

impl UnsafeUnpin for CopyEncoder

§

impl UnwindSafe for CopyEncoder

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<E> Encoder for E
where E: RawEncoder,

Source§

type Item = <E as RawEncoder>::Item

The type of input data the encoder can encode.
Source§

fn encode( &mut self, handle: &mut RmtChannelHandle, primary_data: &[<E as Encoder>::Item], ) -> (usize, EncoderState)

Encode the user data into RMT symbols and write into RMT memory. Read more
Source§

fn reset(&mut self) -> Result<(), EspError>

Reset encoding state. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.