Trait dicom_encoding::transfer_syntax::DataRWAdapter

source ·
pub trait DataRWAdapter<R, W> {
    type Reader: Read;
    type Writer: Write;

    // Required methods
    fn adapt_reader(&self, reader: R) -> Self::Reader
       where R: Read;
    fn adapt_writer(&self, writer: W) -> Self::Writer
       where W: Write;
}
Expand description

An adapter of byte read and write streams.

Required Associated Types§

source

type Reader: Read

The type of the adapted reader.

source

type Writer: Write

The type of the adapted writer.

Required Methods§

source

fn adapt_reader(&self, reader: R) -> Self::Reader
where R: Read,

Adapt a byte reader.

source

fn adapt_writer(&self, writer: W) -> Self::Writer
where W: Write,

Adapt a byte writer.

Implementations on Foreign Types§

source§

impl<'a, T, R, W> DataRWAdapter<R, W> for &'a T
where T: DataRWAdapter<R, W>, R: Read, W: Write,

source§

fn adapt_reader(&self, reader: R) -> Self::Reader
where R: Read,

Adapt a byte reader.

source§

fn adapt_writer(&self, writer: W) -> Self::Writer
where W: Write,

Adapt a byte writer.

§

type Reader = <T as DataRWAdapter<R, W>>::Reader

§

type Writer = <T as DataRWAdapter<R, W>>::Writer

Implementors§

source§

impl<R, W> DataRWAdapter<R, W> for NeverAdapter

§

type Reader = Box<dyn Read>

§

type Writer = Box<dyn Write>