[][src]Trait cntrlr::io::Write

pub trait Write {
    type Error: Debug;
    type Future: Future<Output = Result<usize, Self::Error>> + 'a;
    type FlushFuture: Future<Output = Result<(), Self::Error>> + 'a;
    pub fn write<'a>(&'a mut self, buf: &'a [u8]) -> Self::Future;
pub fn flush<'a>(&'a mut self) -> Self::FlushFuture; }

Allows writing bytes to a sink

Associated Types

type Error: Debug[src]

The error type

type Future: Future<Output = Result<usize, Self::Error>> + 'a[src]

The future for Self::write()

type FlushFuture: Future<Output = Result<(), Self::Error>> + 'a[src]

The future for Self::flush()

Loading content...

Required methods

pub fn write<'a>(&'a mut self, buf: &'a [u8]) -> Self::Future[src]

Write bytes to the device

This writes as many bytes as possible, up to buf.len(), and returns the number of bytes written.

pub fn flush<'a>(&'a mut self) -> Self::FlushFuture[src]

Ensure all written bytes have been transmitted

On devices which do not support this operation, this function does nothing.

Loading content...

Implementors

impl<M, T, R, const N: usize> Write for cntrlr::hw::board::teensy_common::io::Serial<M, T, R, N> where
    M: 'static,
    T: UartTx<M, N> + 'static,
    R: 'static, 
[src]

type Error = SerialError

type Future = impl Future<Output = Result<usize, Self::Error>> + 'a

type FlushFuture = impl Future<Output = Result<(), Self::Error>> + 'a

impl<T, R, const N: usize> Write for cntrlr::hw::board::red_v::io::Serial<T, R, N> where
    T: UartTx<Fe310G002, N> + 'static,
    R: 'static, 
[src]

This is supported on board="red_v" only.

type Error = SerialError

type Future = impl Future<Output = Result<usize, Self::Error>>

type FlushFuture = impl Future<Output = Result<(), Self::Error>>

Loading content...