pub struct EncoderOptions { /* private fields */ }
Expand description
Configuration options for the JSON encoder.
Implementations§
Source§impl EncoderOptions
impl EncoderOptions
Sourcepub fn with_explicit_nulls(self, explicit_nulls: bool) -> EncoderOptions
pub fn with_explicit_nulls(self, explicit_nulls: bool) -> EncoderOptions
Set whether to include nulls in the output or elide them.
Sourcepub fn with_struct_mode(self, struct_mode: StructMode) -> EncoderOptions
pub fn with_struct_mode(self, struct_mode: StructMode) -> EncoderOptions
Set whether to encode structs as JSON objects or JSON arrays of their values.
Sourcepub fn with_encoder_factory(
self,
encoder_factory: Arc<dyn EncoderFactory>,
) -> EncoderOptions
pub fn with_encoder_factory( self, encoder_factory: Arc<dyn EncoderFactory>, ) -> EncoderOptions
Set an optional hook for customizing encoding behavior.
Sourcepub fn explicit_nulls(&self) -> bool
pub fn explicit_nulls(&self) -> bool
Get whether to include nulls in the output or elide them.
Sourcepub fn struct_mode(&self) -> StructMode
pub fn struct_mode(&self) -> StructMode
Get whether to encode structs as JSON objects or JSON arrays of their values.
Sourcepub fn encoder_factory(&self) -> Option<&Arc<dyn EncoderFactory>>
pub fn encoder_factory(&self) -> Option<&Arc<dyn EncoderFactory>>
Get the optional hook for customizing encoding behavior.
Trait Implementations§
Source§impl Clone for EncoderOptions
impl Clone for EncoderOptions
Source§fn clone(&self) -> EncoderOptions
fn clone(&self) -> EncoderOptions
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for EncoderOptions
impl Debug for EncoderOptions
Source§impl Default for EncoderOptions
impl Default for EncoderOptions
Source§fn default() -> EncoderOptions
fn default() -> EncoderOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EncoderOptions
impl !RefUnwindSafe for EncoderOptions
impl Send for EncoderOptions
impl Sync for EncoderOptions
impl Unpin for EncoderOptions
impl !UnwindSafe for EncoderOptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more