#[non_exhaustive]pub struct FilteringConfig {
pub remove_empty_strings: bool,
pub remove_nulls: bool,
pub remove_empty_objects: bool,
pub remove_empty_arrays: bool,
}Expand description
Configuration for filtering operations
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.remove_empty_strings: boolRemove keys with empty string values
remove_nulls: boolRemove keys with null values. Checked as the last step of a value’s
processing pipeline, after any configured value_replacement and
auto_convert_types have both run – so a value that only becomes null
through a replacement (e.g. replacing a sentinel with a recognized null
token) or through type conversion is still caught. This ordering is applied
consistently across .flatten(), .unflatten(), and .normal() mode, and
applies identically to single-document and batch input. A root-level null
(the entire document, not a nested key) is never removed, since there’s no
parent key to omit it under.
remove_empty_objects: boolRemove keys with empty object values
remove_empty_arrays: boolRemove keys with empty array values
Implementations§
Source§impl FilteringConfig
impl FilteringConfig
Sourcepub fn remove_empty_strings(self, enabled: bool) -> Self
pub fn remove_empty_strings(self, enabled: bool) -> Self
Enable removal of empty strings
Sourcepub fn remove_nulls(self, enabled: bool) -> Self
pub fn remove_nulls(self, enabled: bool) -> Self
Enable removal of null values. See the field doc comment on
FilteringConfig::remove_nulls for the ordering guarantee relative to
value_replacement/auto_convert_types.
Sourcepub fn remove_empty_objects(self, enabled: bool) -> Self
pub fn remove_empty_objects(self, enabled: bool) -> Self
Enable removal of empty objects
Sourcepub fn remove_empty_arrays(self, enabled: bool) -> Self
pub fn remove_empty_arrays(self, enabled: bool) -> Self
Enable removal of empty arrays
Sourcepub fn has_any_filter(&self) -> bool
pub fn has_any_filter(&self) -> bool
Check if any filtering is enabled
Trait Implementations§
Source§impl Clone for FilteringConfig
impl Clone for FilteringConfig
Source§fn clone(&self) -> FilteringConfig
fn clone(&self) -> FilteringConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FilteringConfig
impl Debug for FilteringConfig
Source§impl Default for FilteringConfig
impl Default for FilteringConfig
Source§fn default() -> FilteringConfig
fn default() -> FilteringConfig
Auto Trait Implementations§
impl Freeze for FilteringConfig
impl RefUnwindSafe for FilteringConfig
impl Send for FilteringConfig
impl Sync for FilteringConfig
impl Unpin for FilteringConfig
impl UnsafeUnpin for FilteringConfig
impl UnwindSafe for FilteringConfig
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
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>
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>
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