Struct assembly_pack::sd0::read::SegmentedDecoder [−][src]
pub struct SegmentedDecoder<T> { /* fields omitted */ }
Expand description
A sd0
streamed file
use assembly_pack::sd0::read::SegmentedDecoder;
use std::io::{Cursor, Read};
const BYTES: [u8; 30] = [
0x73, 0x64, 0x30, 0x01, 0xff, 0x15, 0x00, 0x00,
0x00, 0x78, 0xda, 0xf3, 0x48, 0xcd, 0xc9, 0xc9,
0x57, 0x08, 0xcf, 0x2f, 0xca, 0x49, 0x51, 0xe4,
0x02, 0x00, 0x20, 0x91, 0x04, 0x48,
];
let mut decoder = SegmentedDecoder::new(Cursor::new(&BYTES)).unwrap();
let mut output = String::new();
decoder.read_to_string(&mut output).unwrap();
assert_eq!(output, "Hello World!\n");
Implementations
Get the inner reader
This panics when the value is invalid, which only happens when a read failed.
Trait Implementations
Read from the (decompressed) stream
This may leave the
Like read
, except that it reads into a slice of buffers. Read more
can_vector
)Determines if this Read
er has an efficient read_vectored
implementation. Read more
Read all bytes until EOF in this source, placing them into buf
. Read more
Read all bytes until EOF in this source, appending them to buf
. Read more
Read the exact number of bytes required to fill buf
. Read more
read_buf
)Pull some bytes from this source into the specified buffer. Read more
read_buf
)Read the exact number of bytes required to fill buf
. Read more
Creates a “by reference” adaptor for this instance of Read
. Read more
Creates an adapter which will chain this stream with another. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for SegmentedDecoder<T> where
T: RefUnwindSafe,
impl<T> Send for SegmentedDecoder<T> where
T: Send,
impl<T> Sync for SegmentedDecoder<T> where
T: Sync,
impl<T> Unpin for SegmentedDecoder<T> where
T: Unpin,
impl<T> UnwindSafe for SegmentedDecoder<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Given the context attached to a nom error, and given the original input to the nom parser, extract more the useful context information. Read more
Given the original input, as well as the context reported by nom, recreate a context in the original string where the error occurred. Read more