Struct embedded_hal_compat::Compat [−][src]
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]
T: DelayMs<u16>,
type Error = Infallible
Enumeration of DelayMs
errors
fn try_delay_ms(&mut self, ms: u16) -> Result<(), Self::Error>
[src]
impl<T> DelayMs<u32> for Compat<T> where
T: DelayMs<u32>,
[src]
T: DelayMs<u32>,
type Error = Infallible
Enumeration of DelayMs
errors
fn try_delay_ms(&mut self, ms: u32) -> Result<(), Self::Error>
[src]
impl<T> DelayUs<u16> for Compat<T> where
T: DelayUs<u16>,
[src]
T: DelayUs<u16>,
type Error = Infallible
Enumeration of DelayMs
errors
fn try_delay_us(&mut self, us: u16) -> Result<(), Self::Error>
[src]
impl<T> DelayUs<u32> for Compat<T> where
T: DelayUs<u32>,
[src]
T: DelayUs<u32>,
type Error = Infallible
Enumeration of DelayMs
errors
fn try_delay_us(&mut self, us: u32) -> Result<(), Self::Error>
[src]
impl<T, E> InputPin for Compat<T> where
T: InputPin<Error = E>,
[src]
T: InputPin<Error = E>,
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]
T: OutputPin<Error = E>,
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
pub fn try_set_state(&mut self, state: PinState) -> Result<(), Self::Error>
[src]
impl<T, E> Read<u8> for Compat<T> where
T: Read<Error = E>,
[src]
T: Read<Error = E>,
type Error = E
Error type
fn try_read(
&mut self,
address: SevenBitAddress,
words: &mut [u8]
) -> Result<(), Self::Error>
[src]
&mut self,
address: SevenBitAddress,
words: &mut [u8]
) -> Result<(), Self::Error>
impl<T, E> Transactional<u8> for Compat<T> where
T: Write<u8, Error = E> + Transfer<u8, Error = E>,
[src]
T: Write<u8, Error = E> + Transfer<u8, Error = E>,
type Error = E
Associated error type
fn try_exec<'a>(
&mut self,
operations: &mut [Operation<'a, u8>]
) -> Result<(), Self::Error>
[src]
&mut self,
operations: &mut [Operation<'a, u8>]
) -> Result<(), Self::Error>
impl<T, E> Transfer<u8> for Compat<T> where
T: Transfer<u8, Error = E>,
[src]
T: Transfer<u8, Error = E>,
type Error = E
Error type
fn try_transfer<'a>(
&mut self,
words: &'a mut [u8]
) -> Result<&'a [u8], Self::Error>
[src]
&mut self,
words: &'a mut [u8]
) -> Result<&'a [u8], Self::Error>
impl<T, E> Write<u8> for Compat<T> where
T: Write<Error = E>,
[src]
T: Write<Error = E>,
type Error = E
Error type
fn try_write(
&mut self,
address: SevenBitAddress,
words: &[u8]
) -> Result<(), Self::Error>
[src]
&mut self,
address: SevenBitAddress,
words: &[u8]
) -> Result<(), Self::Error>
impl<T, E> Write<u8> for Compat<T> where
T: Write<u8, Error = E>,
[src]
T: Write<u8, Error = E>,
type Error = E
The type of error that can occur when writing
fn try_bwrite_all(&mut self, words: &[u8]) -> Result<(), Self::Error>
[src]
fn try_bflush(&mut self) -> Result<(), Self::Error>
[src]
impl<T, E> Write<u8> for Compat<T> where
T: Write<u8, Error = E>,
[src]
T: Write<u8, Error = E>,
impl<T, E> WriteIter<u8> for Compat<T> where
T: WriteIter<Error = E>,
[src]
T: WriteIter<Error = E>,
type Error = E
Error type
fn try_write_iter<B>(
&mut self,
address: SevenBitAddress,
words: B
) -> Result<(), Self::Error> where
B: IntoIterator<Item = u8>,
[src]
&mut self,
address: SevenBitAddress,
words: B
) -> Result<(), Self::Error> where
B: IntoIterator<Item = u8>,
impl<T, E> WriteIter<u8> for Compat<T> where
T: WriteIter<u8, Error = E>,
[src]
T: WriteIter<u8, Error = E>,
type Error = E
Error type
fn try_write_iter<WI>(&mut self, words: WI) -> Result<(), Self::Error> where
WI: IntoIterator<Item = u8>,
[src]
WI: IntoIterator<Item = u8>,
impl<T, E> WriteIterRead<u8> for Compat<T> where
T: WriteIterRead<Error = E>,
[src]
T: WriteIterRead<Error = E>,
type Error = E
Error type
fn try_write_iter_read<B>(
&mut self,
address: SevenBitAddress,
bytes: B,
buffer: &mut [u8]
) -> Result<(), Self::Error> where
B: IntoIterator<Item = u8>,
[src]
&mut self,
address: SevenBitAddress,
bytes: B,
buffer: &mut [u8]
) -> Result<(), Self::Error> where
B: IntoIterator<Item = u8>,
impl<T, E> WriteRead<u8> for Compat<T> where
T: WriteRead<Error = E>,
[src]
T: WriteRead<Error = E>,
type Error = E
Error type
fn try_write_read(
&mut self,
address: SevenBitAddress,
bytes: &[u8],
buffer: &mut [u8]
) -> Result<(), Self::Error>
[src]
&mut self,
address: SevenBitAddress,
bytes: &[u8],
buffer: &mut [u8]
) -> Result<(), Self::Error>
Auto Trait Implementations
impl<T> Send for Compat<T> where
T: Send,
T: Send,
impl<T> Sync for Compat<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Compat<T> where
T: Unpin,
T: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,