Struct embedded_hal_compat::Compat[][src]

pub struct Compat<T> { /* fields omitted */ }

Compatibility container object. This is generic over different E-H types and will provide adaption depending on the bound type.

Implementations

impl<T> Compat<T>[src]

pub fn new(inner: T) -> Compat<T>[src]

Create a new compatibility wrapper object

pub fn inner(&self) -> &T[src]

Fetch a reference to the wrapped object

pub fn inner_mut(&mut self) -> &mut T[src]

Fetch a mutable reference to the wrapped object

pub fn unwrap(self) -> T[src]

Destroy the compatibility wrapper, returning the wrapped object

Trait Implementations

impl<T> DelayMs<u16> for Compat<T> where
    T: DelayMs<u16>, 
[src]

type Error = Infallible

Enumeration of DelayMs errors

impl<T> DelayMs<u32> for Compat<T> where
    T: DelayMs<u32>, 
[src]

type Error = Infallible

Enumeration of DelayMs errors

impl<T> DelayUs<u16> for Compat<T> where
    T: DelayUs<u16>, 
[src]

type Error = Infallible

Enumeration of DelayMs errors

impl<T> DelayUs<u32> for Compat<T> where
    T: DelayUs<u32>, 
[src]

type Error = Infallible

Enumeration of DelayMs errors

impl<T, E> InputPin for Compat<T> where
    T: InputPin<Error = E>, 
[src]

type Error = E

Error type

fn try_is_high(&self) -> Result<bool, Self::Error>[src]

Is the input pin high?

fn try_is_low(&self) -> Result<bool, Self::Error>[src]

Is the input pin low?

impl<T, E> OutputPin for Compat<T> where
    T: OutputPin<Error = E>, 
[src]

type Error = E

Error type

fn try_set_high(&mut self) -> Result<(), Self::Error>[src]

Set the output as high

fn try_set_low(&mut self) -> Result<(), Self::Error>[src]

Set the output as low

impl<T, E> Read<u8> for Compat<T> where
    T: Read<Error = E>, 
[src]

type Error = E

Error type

impl<T, E> Transactional<u8> for Compat<T> where
    T: Write<u8, Error = E> + Transfer<u8, Error = E>, 
[src]

type Error = E

Associated error type

impl<T, E> Transfer<u8> for Compat<T> where
    T: Transfer<u8, Error = E>, 
[src]

type Error = E

Error type

impl<T, E> Write<u8> for Compat<T> where
    T: Write<Error = E>, 
[src]

type Error = E

Error type

impl<T, E> Write<u8> for Compat<T> where
    T: Write<u8, Error = E>, 
[src]

type Error = E

The type of error that can occur when writing

impl<T, E> Write<u8> for Compat<T> where
    T: Write<u8, Error = E>, 
[src]

type Error = E

Error type

impl<T, E> WriteIter<u8> for Compat<T> where
    T: WriteIter<Error = E>, 
[src]

type Error = E

Error type

impl<T, E> WriteIter<u8> for Compat<T> where
    T: WriteIter<u8, Error = E>, 
[src]

type Error = E

Error type

impl<T, E> WriteIterRead<u8> for Compat<T> where
    T: WriteIterRead<Error = E>, 
[src]

type Error = E

Error type

impl<T, E> WriteRead<u8> for Compat<T> where
    T: WriteRead<Error = E>, 
[src]

type Error = E

Error type

Auto Trait Implementations

impl<T> Send for Compat<T> where
    T: Send

impl<T> Sync for Compat<T> where
    T: Sync

impl<T> Unpin for Compat<T> where
    T: Unpin

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> IntoCompat<T> for T[src]

pub fn compat(Self) -> Compat<T>[src]

Create an e-h-c wrapper around and e-h object Available methods depend on the wrapped type

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.