trouble-host

Crates

git

Versions

default

Flavors

Struct SerialTransport

Source
pub struct SerialTransport<M, R, W>
where M: RawMutex,
{ /* private fields */ }
Expand description

HCI transport layer for a split serial bus using the UART transport layer protocol 📖

Implementations§

Source§

impl<M, R, W> SerialTransport<M, R, W>
where M: RawMutex, R: Read, W: Write,

Source

pub fn new(reader: R, writer: W) -> SerialTransport<M, R, W>

Create a new instance.

Trait Implementations§

Source§

impl<M, R, W, E> ErrorType for SerialTransport<M, R, W>
where M: RawMutex, R: ErrorType<Error = E>, W: ErrorType<Error = E>, E: Error,

Source§

type Error = Error<E>

Error type of all the IO operations on this type.
Source§

impl<M, R, W, E> Transport for SerialTransport<M, R, W>
where M: RawMutex, R: Read<Error = E>, W: Write<Error = E>, E: Error,

Source§

async fn read<'a>( &self, rx: &'a mut [u8], ) -> Result<ControllerToHostPacket<'a>, <SerialTransport<M, R, W> as ErrorType>::Error>

Read a complete HCI packet into the rx buffer
Source§

async fn write<T>( &self, tx: &T, ) -> Result<(), <SerialTransport<M, R, W> as ErrorType>::Error>

Write a complete HCI packet from the tx buffer
Source§

impl<M, R, W, E> Transport for SerialTransport<M, R, W>
where M: RawMutex, R: Read<Error = E>, W: Write<Error = E>, E: Error,

Source§

fn read<'a>( &self, rx: &'a mut [u8], ) -> Result<ControllerToHostPacket<'a>, TryError<<SerialTransport<M, R, W> as ErrorType>::Error>>

Read a complete HCI packet into the rx buffer
Source§

fn write<T>( &self, tx: &T, ) -> Result<(), TryError<<SerialTransport<M, R, W> as ErrorType>::Error>>

Write a complete HCI packet from the tx buffer

Auto Trait Implementations§

§

impl<M, R, W> !Freeze for SerialTransport<M, R, W>

§

impl<M, R, W> !RefUnwindSafe for SerialTransport<M, R, W>

§

impl<M, R, W> Send for SerialTransport<M, R, W>
where M: Send, R: Send, W: Send,

§

impl<M, R, W> Sync for SerialTransport<M, R, W>
where M: Sync, R: Send, W: Send,

§

impl<M, R, W> Unpin for SerialTransport<M, R, W>
where M: Unpin, R: Unpin, W: Unpin,

§

impl<M, R, W> UnwindSafe for SerialTransport<M, R, W>
where M: UnwindSafe, R: UnwindSafe, W: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.