[][src]Struct async_stm32f1xx::serial::TxSink

#[must_use = "sinks do nothing unless polled"]pub struct TxSink<'a, BUF, PAYLOAD>(_);

A Sink-based asynchronous abstraction over a DMA transmitter.

Examples

let mut tx_sink = TxSink3::new(tx_buf, tx.with_dma(channels.2));
// Spams "01234567"
loop {
    tx_sink.send(*b"01234567").await.unwrap();
}

Implementations

impl<'a, BUF, PAYLOAD> TxSink<'a, BUF, PAYLOAD> where
    TxSink<'a, BUF, PAYLOAD>: Sink<BUF, Error = Infallible>,
    PAYLOAD: Unpin
[src]

pub async fn release(__arg0: Self) -> (&'a mut BUF, PAYLOAD)[src]

Releases the buffer and payload peripheral.

impl<'a, BUF> TxSink<'a, BUF, TxDma<Tx<USART1>, C4>>[src]

pub fn new(buf: &'a mut BUF, tx: TxDma1) -> Self[src]

Creates a new TxSink from the specified buffer and DMA transmitter.

impl<'a, BUF> TxSink<'a, BUF, TxDma<Tx<USART2>, C7>>[src]

pub fn new(buf: &'a mut BUF, tx: TxDma2) -> Self[src]

Creates a new TxSink from the specified buffer and DMA transmitter.

impl<'a, BUF> TxSink<'a, BUF, TxDma<Tx<USART3>, C2>>[src]

pub fn new(buf: &'a mut BUF, tx: TxDma3) -> Self[src]

Creates a new TxSink from the specified buffer and DMA transmitter.

Trait Implementations

impl<BUF, PAYLOAD> Sink<BUF> for TxSink<'static, BUF, PAYLOAD> where
    BUF: AsSlice<Element = u8>,
    PAYLOAD: WriteDma<BUF, &'static mut BUF, u8> + Unpin,
    TransferFuture<Transfer<R, &'static mut BUF, PAYLOAD>>: Future<Output = (&'static mut BUF, PAYLOAD)>, 
[src]

type Error = Infallible

The type of value produced by the sink when an error occurs.

Auto Trait Implementations

impl<'a, BUF, PAYLOAD> Send for TxSink<'a, BUF, PAYLOAD> where
    BUF: Send,
    PAYLOAD: Send

impl<'a, BUF, PAYLOAD> Sync for TxSink<'a, BUF, PAYLOAD> where
    BUF: Sync,
    PAYLOAD: Sync

impl<'a, BUF, PAYLOAD> Unpin for TxSink<'a, BUF, PAYLOAD> where
    PAYLOAD: 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> Same<T> for T

type Output = T

Should always be Self

impl<T, Item> SinkExt<Item> for T where
    T: Sink<Item> + ?Sized
[src]

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.