Skip to main content

AntReader

Struct AntReader 

Source
pub struct AntReader<R: Read> {
    pub manifest: Manifest,
    pub verified: bool,
    pub version: FormatVersion,
    pub minor_ahead: bool,
    /* private fields */
}
Expand description

Streaming .ant reader. Yields records after validating the manifest; [AntReader::finish] (or reading through the trailer) verifies counts + hash.

Fields§

§manifest: Manifest§verified: bool

Set once the trailer was seen and verified.

§version: FormatVersion

Version parsed from the manifest. Same major as this build, or new would have refused the file.

§minor_ahead: bool

The file was written by a NEWER minor than this build. Readable by policy (minors are additive-only), but it may carry record kinds this build skipped — a caller that reports completeness to a user should say so.

Implementations§

Source§

impl<R: Read> AntReader<R>

Source

pub fn new(input: R) -> Result<Self, AntError>

Source

pub fn next_record(&mut self) -> Result<Option<AntRecord>, AntError>

Next data record; None after a VERIFIED trailer. Unknown-kind lines are skipped (forward compatibility) but still hashed.

Auto Trait Implementations§

§

impl<R> !UnwindSafe for AntReader<R>

§

impl<R> Freeze for AntReader<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for AntReader<R>
where R: RefUnwindSafe,

§

impl<R> Send for AntReader<R>
where R: Send,

§

impl<R> Sync for AntReader<R>
where R: Sync,

§

impl<R> Unpin for AntReader<R>
where R: Unpin,

§

impl<R> UnsafeUnpin for AntReader<R>
where R: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.