Skip to main content

Datalink

Trait Datalink 

Source
pub trait Datalink {
    type ReadError: Error;
    type WriteError: Error;
    type Reader<'a>: DatalinkRead<Error = Self::ReadError>
       where Self: 'a;
    type Writer<'a>: DatalinkWrite<Error = Self::WriteError>
       where Self: 'a;

    // Required method
    fn split(&mut self) -> (Self::Reader<'_>, Self::Writer<'_>);
}
Expand description

A bidirectional data link that can be split into independent read and write halves.

Required Associated Types§

Source

type ReadError: Error

Error type for read operations.

Source

type WriteError: Error

Error type for write operations.

Source

type Reader<'a>: DatalinkRead<Error = Self::ReadError> where Self: 'a

Read half type.

Source

type Writer<'a>: DatalinkWrite<Error = Self::WriteError> where Self: 'a

Write half type.

Required Methods§

Source

fn split(&mut self) -> (Self::Reader<'_>, Self::Writer<'_>)

Split into independent read and write halves.

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.

Implementations on Foreign Types§

Source§

type ReadError = <R as DatalinkRead>::Error

Source§

type WriteError = <W as DatalinkWrite>::Error

Source§

type Reader<'a> = &'a mut R where Self: 'a

Source§

type Writer<'a> = &'a mut W where Self: 'a

Source§

fn split(&mut self) -> (&mut R, &mut W)

Implementors§