IntoDataStream

Trait IntoDataStream 

Source
pub trait IntoDataStream {
    type Reader: ReadExt + SeekExt;

    // Required method
    fn into_stream(self, endian: Endian) -> Self::Reader;
}
Expand description

Trait to convert data types into an endian-aware stream.

§Example

fn parse_data<T: IntoDataStream>(input: T) {
    let mut data = input.into_stream(Endian::Little);
}

Required Associated Types§

Required Methods§

Source

fn into_stream(self, endian: Endian) -> Self::Reader

Implementations on Foreign Types§

Source§

impl IntoDataStream for &File

Source§

type Reader = DataStream<&File>

Source§

fn into_stream(self, endian: Endian) -> Self::Reader

Source§

impl IntoDataStream for Box<[u8]>

Source§

type Reader = DataCursor

Source§

fn into_stream(self, endian: Endian) -> Self::Reader

Source§

impl IntoDataStream for Arc<File>

Source§

impl IntoDataStream for File

Source§

impl IntoDataStream for Empty

Source§

impl<'a> IntoDataStream for &'a [u8]

Source§

type Reader = DataCursorRef<'a>

Source§

fn into_stream(self, endian: Endian) -> Self::Reader

Source§

impl<'a> IntoDataStream for &'a mut [u8]

Source§

type Reader = DataCursorMut<'a>

Source§

fn into_stream(self, endian: Endian) -> Self::Reader

Source§

impl<R: Read + Seek> IntoDataStream for Box<R>

Source§

type Reader = DataStream<Box<R>>

Source§

fn into_stream(self, endian: Endian) -> Self::Reader

Source§

impl<R: Read + Seek> IntoDataStream for BufReader<R>

Source§

impl<T: AsRef<[u8]>> IntoDataStream for Cursor<T>

Source§

type Reader = DataStream<Cursor<T>>

Source§

fn into_stream(self, endian: Endian) -> Self::Reader

Implementors§