Skip to main content

BytesEncoder

Struct BytesEncoder 

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

An encoder that dynamically encodes a user space byte stream into RMT symbols.

It is usually used to encode dynamic data, e.g., the address and command fields in the IR protocol.

Implementations§

Source§

impl BytesEncoder

Source

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

Constructs a new bytes encoder with default configuration.

Source

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

Constructs a new bytes encoder with the provided configuration.

Trait Implementations§

Source§

impl Debug for BytesEncoder

Source§

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

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

impl Drop for BytesEncoder

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl RawEncoder for BytesEncoder

Source§

type Item = u8

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 BytesEncoder

§

impl RefUnwindSafe for BytesEncoder

§

impl !Send for BytesEncoder

§

impl !Sync for BytesEncoder

§

impl Unpin for BytesEncoder

§

impl UnsafeUnpin for BytesEncoder

§

impl UnwindSafe for BytesEncoder

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.