pub struct Encoder<W>where
W: Write,{ /* private fields */ }Expand description
Type for encoding files and streams of DBN records in newline-delimited JSON (ndjson).
Implementations§
source§impl<W> Encoder<W>where
W: Write,
impl<W> Encoder<W>where W: Write,
sourcepub fn new(
writer: W,
should_pretty_print: bool,
use_pretty_px: bool,
use_pretty_ts: bool
) -> Self
pub fn new( writer: W, should_pretty_print: bool, use_pretty_px: bool, use_pretty_ts: bool ) -> Self
Creates a new instance of Encoder. If should_pretty_print is true,
each JSON object will be nicely formatted and indented, instead of the default
compact output with no whitespace between key-value pairs.
Trait Implementations§
source§impl<W> EncodeDbn for Encoder<W>where
W: Write,
impl<W> EncodeDbn for Encoder<W>where W: Write,
source§fn encode_record<R: DbnEncodable>(&mut self, record: &R) -> Result<bool>
fn encode_record<R: DbnEncodable>(&mut self, record: &R) -> Result<bool>
Encodes a single DBN record of type
R. Read moresource§fn encode_records<R: DbnEncodable>(&mut self, records: &[R]) -> Result<()>
fn encode_records<R: DbnEncodable>(&mut self, records: &[R]) -> Result<()>
Encodes a slice of DBN records. Read more
source§fn encode_stream<R: DbnEncodable>(
&mut self,
stream: impl StreamingIterator<Item = R>
) -> Result<()>
fn encode_stream<R: DbnEncodable>( &mut self, stream: impl StreamingIterator<Item = R> ) -> Result<()>
Encodes a stream of DBN records. Read more
source§unsafe fn encode_record_ref(
&mut self,
record: RecordRef<'_>,
ts_out: bool
) -> Result<bool>
unsafe fn encode_record_ref( &mut self, record: RecordRef<'_>, ts_out: bool ) -> Result<bool>
Encodes a single DBN record. Read more
source§fn encode_decoded<D: DecodeDbn>(&mut self, decoder: D) -> Result<()>
fn encode_decoded<D: DecodeDbn>(&mut self, decoder: D) -> Result<()>
Encodes DBN records directly from a DBN decoder. Read more
source§fn encode_decoded_with_limit<D: DecodeDbn>(
&mut self,
decoder: D,
limit: NonZeroU64
) -> Result<()>
fn encode_decoded_with_limit<D: DecodeDbn>( &mut self, decoder: D, limit: NonZeroU64 ) -> Result<()>
Encodes DBN records directly from a DBN decoder, outputting no more than
limit records. Read moreAuto Trait Implementations§
impl<W> RefUnwindSafe for Encoder<W>where W: RefUnwindSafe,
impl<W> Send for Encoder<W>where W: Send,
impl<W> Sync for Encoder<W>where W: Sync,
impl<W> Unpin for Encoder<W>where W: Unpin,
impl<W> UnwindSafe for Encoder<W>where W: 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