pub struct Encoder<W>where
W: Write,{ /* private fields */ }Expand description
Type for encoding files and streams of DBN records in JSON lines.
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.
Sourcepub fn builder(writer: W) -> EncoderBuilder<W>
pub fn builder(writer: W) -> EncoderBuilder<W>
Creates a builder for configuring an Encoder object.
Trait Implementations§
Source§impl<W> EncodeDbn for Encoder<W>where
W: Write,
impl<W> EncodeDbn for Encoder<W>where
W: Write,
Source§fn encode_stream<R: DbnEncodable>(
&mut self,
stream: impl FallibleStreamingIterator<Item = R, Error = Error>,
) -> Result<()>
fn encode_stream<R: DbnEncodable>( &mut self, stream: impl FallibleStreamingIterator<Item = R, Error = Error>, ) -> Result<()>
Encodes a stream of DBN records. Read more
Source§fn encode_decoded<D: DecodeRecordRef + DbnMetadata>(
&mut self,
decoder: D,
) -> Result<()>
fn encode_decoded<D: DecodeRecordRef + DbnMetadata>( &mut self, decoder: D, ) -> Result<()>
Encodes DBN records directly from a DBN decoder. Read more
Source§fn encode_decoded_with_limit<D: DecodeRecordRef + DbnMetadata>(
&mut self,
decoder: D,
limit: NonZeroU64,
) -> Result<()>
fn encode_decoded_with_limit<D: DecodeRecordRef + DbnMetadata>( &mut self, decoder: D, limit: NonZeroU64, ) -> Result<()>
Encodes DBN records directly from a DBN decoder, outputting no more than
limit records. Read moreSource§impl<W> EncodeRecord for Encoder<W>where
W: Write,
impl<W> EncodeRecord for Encoder<W>where
W: Write,
Source§fn encode_record<R: DbnEncodable>(&mut self, record: &R) -> Result<()>
fn encode_record<R: DbnEncodable>(&mut self, record: &R) -> Result<()>
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§impl<W> EncodeRecordRef for Encoder<W>where
W: Write,
impl<W> EncodeRecordRef for Encoder<W>where
W: Write,
Source§impl<W> EncodeRecordTextExt for Encoder<W>where
W: Write,
impl<W> EncodeRecordTextExt for Encoder<W>where
W: Write,
Auto Trait Implementations§
impl<W> Freeze for Encoder<W>where
W: Freeze,
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> UnsafeUnpin for Encoder<W>where
W: UnsafeUnpin,
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