Skip to main content

PhysicalRead

Trait PhysicalRead 

Source
pub trait PhysicalRead {
    type Error;

    // Required method
    fn read(
        &mut self,
        buffer: &mut [u8],
    ) -> impl Future<Output = Result<usize, Self::Error>>;
}
Expand description

Async trait for reading raw bytes from a physical channel.

Required Associated Types§

Source

type Error

Error type for read operations.

Required Methods§

Source

fn read( &mut self, buffer: &mut [u8], ) -> impl Future<Output = Result<usize, Self::Error>>

Reads bytes into the buffer, returning the number of bytes read.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§