Skip to main content

EncoderWrapper

Struct EncoderWrapper 

Source
pub struct EncoderWrapper<E>(/* private fields */);
Expand description

A type implementing Encoder can not be directly used by the driver, because the driver expects a different interface (see RawEncoder).

This type adapts an Encoder to a RawEncoder, taking care of the unsafe parts.

Implementations§

Source§

impl<E: Encoder> EncoderWrapper<E>

Source

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

Trait Implementations§

Source§

impl<E: Debug> Debug for EncoderWrapper<E>

Source§

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

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

impl<E: Encoder> RawEncoder for EncoderWrapper<E>

Source§

type Item = <E as Encoder>::Item

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<E> Freeze for EncoderWrapper<E>

§

impl<E> RefUnwindSafe for EncoderWrapper<E>
where E: RefUnwindSafe,

§

impl<E> Send for EncoderWrapper<E>
where E: Send,

§

impl<E> Sync for EncoderWrapper<E>
where E: Sync,

§

impl<E> Unpin for EncoderWrapper<E>

§

impl<E> UnsafeUnpin for EncoderWrapper<E>

§

impl<E> UnwindSafe for EncoderWrapper<E>
where E: UnwindSafe,

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.