pub struct Reader<const D: usize, R> { /* private fields */ }
Expand description
A pseudo-shuffled SAF file reader.
Implementations§
Source§impl<const D: usize, R> Reader<D, R>where
R: BufRead,
A pseudo-shuffled SAF file reader.
impl<const D: usize, R> Reader<D, R>where
R: BufRead,
A pseudo-shuffled SAF file reader.
Sourcepub fn into_inner(self) -> R
pub fn into_inner(self) -> R
Returns the inner reader, consuming self
.
Sourcepub fn new(reader: R, header: Header) -> Self
pub fn new(reader: R, header: Header) -> Self
Creates a new reader.
The stream is expected to be positioned after the header.
Sourcepub fn read_header(&mut self) -> Result<Header>
pub fn read_header(&mut self) -> Result<Header>
Reads the header from the reader.
The stream is assumed to be positioned at the beginning.
Trait Implementations§
Source§impl<const D: usize, R> ReadSite for Reader<D, R>
impl<const D: usize, R> ReadSite for Reader<D, R>
Source§fn read_site(&mut self, buf: &mut Self::Site) -> Result<ReadStatus>
fn read_site(&mut self, buf: &mut Self::Site) -> Result<ReadStatus>
Reads a single site into the provided buffer. Read more
Source§fn read_site_unnormalised(&mut self, buf: &mut Self::Site) -> Result<ReadStatus>
fn read_site_unnormalised(&mut self, buf: &mut Self::Site) -> Result<ReadStatus>
Reads a single site into the provided buffer without normalising out of log-space. Read more
Source§impl<const D: usize, R> Seek for Reader<D, R>
impl<const D: usize, R> Seek for Reader<D, R>
Source§fn seek(&mut self, pos: SeekFrom) -> Result<u64>
fn seek(&mut self, pos: SeekFrom) -> Result<u64>
Seek to an offset, in bytes, in a stream. Read more
1.55.0 · Source§fn rewind(&mut self) -> Result<(), Error>
fn rewind(&mut self) -> Result<(), Error>
Rewind to the beginning of a stream. Read more
Source§fn stream_len(&mut self) -> Result<u64, Error>
fn stream_len(&mut self) -> Result<u64, Error>
🔬This is a nightly-only experimental API. (
seek_stream_len
)Returns the length of this stream (in bytes). Read more
Auto Trait Implementations§
impl<const D: usize, R> Freeze for Reader<D, R>where
R: Freeze,
impl<const D: usize, R> RefUnwindSafe for Reader<D, R>where
R: RefUnwindSafe,
impl<const D: usize, R> Send for Reader<D, R>where
R: Send,
impl<const D: usize, R> Sync for Reader<D, R>where
R: Sync,
impl<const D: usize, R> Unpin for Reader<D, R>where
R: Unpin,
impl<const D: usize, R> UnwindSafe for Reader<D, R>where
R: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more