Struct dbn::decode::dbz::Decoder

source ·
pub struct Decoder<R: BufRead> { /* private fields */ }
👎Deprecated since 0.3.0: DBZ was renamed to DBN and the format was changed to no longer rely on Zstd.
Expand description

Object for reading, parsing, and serializing a legacy Databento Binary Encoding (DBZ) file.

Implementations§

source§

impl Decoder<BufReader<File>>

source

pub fn from_file(path: impl AsRef<Path>) -> Result<Self>

👎Deprecated since 0.3.0: DBZ was renamed to DBN and the format was changed to no longer rely on Zstd.

Creates a new Decoder from the file at path. This function reads the metadata, but does not read the body of the file.

Errors

This function will return an error if path doesn’t exist. It will also return an error if it is unable to parse the metadata from the file.

source§

impl<R: BufRead> Decoder<R>

source

pub fn new(reader: R) -> Result<Self>

👎Deprecated since 0.3.0: DBZ was renamed to DBN and the format was changed to no longer rely on Zstd.

Creates a new DBZ Decoder from reader.

Errors

This function will return an error if it is unable to parse the metadata in reader.

source

pub fn with_upgrade_policy( reader: R, upgrade_policy: VersionUpgradePolicy ) -> Result<Self>

👎Deprecated since 0.3.0: DBZ was renamed to DBN and the format was changed to no longer rely on Zstd.

Creates a new DBZ Decoder from reader. It will decode records from according to upgrade_policy.

Errors

This function will return an error if it is unable to parse the metadata in `reader.

Trait Implementations§

source§

impl<R: BufRead> DecodeDbn for Decoder<R>

source§

fn decode_stream<T: HasRType>(self) -> StreamIterDecoder<Self, T>where Self: Sized,

Try to decode the DBZ file into a streaming iterator. This decodes the data lazily.

Errors

This function will return an error if the zstd portion of the DBZ file was compressed in an unexpected manner.

source§

fn metadata(&self) -> &Metadata

Returns a reference to the decoded Metadata.
source§

fn decode_record<T: HasRType>(&mut self) -> Result<Option<&T>>

Tries to decode a reference to a single record of type T. Returns Ok(None) if the input has been exhausted. Read more
source§

fn decode_records<T: HasRType + Clone>(self) -> Result<Vec<T>>where Self: Sized,

Tries to decode all records into a Vec. This eagerly decodes the data. Read more
source§

impl<R: BufRead> DecodeRecordRef for Decoder<R>

source§

fn decode_record_ref(&mut self) -> Result<Option<RecordRef<'_>>>

Tries to decode a generic reference a record. Returns Ok(None) if input has been exhausted. Read more

Auto Trait Implementations§

§

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

§

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

§

impl<R> !Sync for Decoder<R>

§

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

§

impl<R> UnwindSafe for Decoder<R>where R: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
source§

impl<T> Ungil for Twhere T: Send,