dbn::decode::dbz

Struct 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. Will upgrade records from previous versions to the current version.

§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> DbnMetadata for Decoder<R>

Source§

fn metadata(&self) -> &Metadata

Returns an immutable reference to the decoded Metadata.
Source§

fn metadata_mut(&mut self) -> &mut Metadata

Returns a mutable reference to the decoded Metadata.
Source§

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

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
Source§

impl<R: BufRead> DecodeStream 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.

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<R> !UnwindSafe for Decoder<R>

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, 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.
Source§

impl<T> Ungil for T
where T: Send,