Trait atat::AtatIngress

source ·
pub trait AtatIngress {
    // Required methods
    fn write_buf(&mut self) -> &mut [u8];
    fn try_advance(&mut self, commit: usize) -> Result<(), Error>;
    async fn advance(&mut self, commit: usize);
    fn clear(&mut self);

    // Provided methods
    fn try_write(&mut self, buf: &[u8]) -> Result<usize, Error> { ... }
    async fn write(&mut self, buf: &[u8]) { ... }
    async fn read_from(&mut self, serial: &mut impl Read) -> ! { ... }
}

Required Methods§

source

fn write_buf(&mut self) -> &mut [u8]

Get the write buffer of the ingress

Bytes written to the buffer must be committed by calling advance.

source

fn try_advance(&mut self, commit: usize) -> Result<(), Error>

Commit a given number of written bytes to the ingress and make them visible to the digester.

source

async fn advance(&mut self, commit: usize)

Commit a given number of written bytes to the ingress and make them visible to the digester.

source

fn clear(&mut self)

Provided Methods§

source

fn try_write(&mut self, buf: &[u8]) -> Result<usize, Error>

Write a buffer to the ingress and return how many bytes were written.

source

async fn write(&mut self, buf: &[u8])

Write a buffer to the ingress

source

async fn read_from(&mut self, serial: &mut impl Read) -> !

Read all bytes from the provided serial and ingest the read bytes into the ingress from where they will be processed

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<D: Digester, Urc: AtatUrc, const RES_BUF_SIZE: usize, const URC_CAPACITY: usize, const URC_SUBSCRIBERS: usize> AtatIngress for Ingress<'_, D, Urc, RES_BUF_SIZE, URC_CAPACITY, URC_SUBSCRIBERS>