pub struct Dbz<R: BufRead> { /* private fields */ }
Expand description
Object for reading, parsing, and serializing a Databento Binary Encoding (DBZ) file.
Implementations§
Source§impl<R: BufRead> Dbz<R>
impl<R: BufRead> Dbz<R>
Sourcepub fn schema(&self) -> Schema
pub fn schema(&self) -> Schema
Returns the Schema
of the DBZ data. The schema also indicates the record type T
for
Self::try_into_iter
.
Sourcepub fn metadata(&self) -> &Metadata
pub fn metadata(&self) -> &Metadata
Returns a reference to all metadata read from the Dbz data in a Metadata
object.
Sourcepub fn try_into_iter<T: ConstTypeId>(self) -> Result<DbzStreamIter<R, T>>
pub fn try_into_iter<T: ConstTypeId>(self) -> Result<DbzStreamIter<R, T>>
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§impl<R: BufRead> Dbz<R>
impl<R: BufRead> Dbz<R>
Sourcepub fn write_to(
self,
writer: impl Write,
encoding: OutputEncoding,
) -> Result<()>
pub fn write_to( self, writer: impl Write, encoding: OutputEncoding, ) -> Result<()>
Streams the contents of the Dbz
to writer
encoding it using encoding
. Consumes the
Dbz
object.
§Errors
This function returns an error if Dbz::schema()
is
Schema::Statistics
. It will also
return an error if there’s an issue writing the output to writer
.
Trait Implementations§
Auto Trait Implementations§
impl<R> Freeze for Dbz<R>where
R: Freeze,
impl<R> RefUnwindSafe for Dbz<R>where
R: RefUnwindSafe,
impl<R> Send for Dbz<R>where
R: Send,
impl<R> Sync for Dbz<R>where
R: Sync,
impl<R> Unpin for Dbz<R>where
R: Unpin,
impl<R> UnwindSafe for Dbz<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