pub struct CollectorSerializer<'a, C: KVCategorizer>(/* private fields */);
Expand description

This serializer collects all KV pairs into a Vec, converting the values to String. It filters out the one that are of KVCategory::Ignore

Implementations§

source§

impl<'a, C: KVCategorizer> CollectorSerializer<'a, C>

source

pub fn new(categorizer: &'a C) -> Self

Create a collector serializer that will use the given categorizer to collect desired values

source

pub fn into_inner(self) -> Vec<(Key, String)>

Once done collecting KV pairs call this to retrieve collected values

Trait Implementations§

source§

impl<'a, C: KVCategorizer> Serializer for CollectorSerializer<'a, C>

source§

fn emit_none(&mut self, key: Key) -> Result

Emit None

source§

fn emit_unit(&mut self, key: Key) -> Result

Emit ()

source§

fn emit_usize(&mut self, key: Key, val: usize) -> Result

Emit $t

source§

fn emit_isize(&mut self, key: Key, val: isize) -> Result

Emit $t

source§

fn emit_bool(&mut self, key: Key, val: bool) -> Result

Emit $t

source§

fn emit_char(&mut self, key: Key, val: char) -> Result

Emit $t

source§

fn emit_u8(&mut self, key: Key, val: u8) -> Result

Emit $t

source§

fn emit_i8(&mut self, key: Key, val: i8) -> Result

Emit $t

source§

fn emit_u16(&mut self, key: Key, val: u16) -> Result

Emit $t

source§

fn emit_i16(&mut self, key: Key, val: i16) -> Result

Emit $t

source§

fn emit_u32(&mut self, key: Key, val: u32) -> Result

Emit $t

source§

fn emit_i32(&mut self, key: Key, val: i32) -> Result

Emit $t

source§

fn emit_f32(&mut self, key: Key, val: f32) -> Result

Emit $t

source§

fn emit_u64(&mut self, key: Key, val: u64) -> Result

Emit $t

source§

fn emit_i64(&mut self, key: Key, val: i64) -> Result

Emit $t

source§

fn emit_f64(&mut self, key: Key, val: f64) -> Result

Emit $t

source§

fn emit_str(&mut self, key: Key, val: &str) -> Result

Emit $t

source§

fn emit_arguments(&mut self, key: Key, val: &Arguments<'_>) -> Result

Emit $t

source§

fn emit_u128(&mut self, key: &'static str, val: u128) -> Result<(), Error>

Emit u128
source§

fn emit_i128(&mut self, key: &'static str, val: i128) -> Result<(), Error>

Emit i128
source§

fn emit_serde( &mut self, key: &'static str, value: &dyn SerdeValue ) -> Result<(), Error>

Emit a value implementing serde::Serialize Read more
source§

fn emit_error( &mut self, key: &'static str, error: &(dyn Error + 'static) ) -> Result<(), Error>

Emit a type implementing std::error::Error Read more

Auto Trait Implementations§

§

impl<'a, C> RefUnwindSafe for CollectorSerializer<'a, C>
where C: RefUnwindSafe,

§

impl<'a, C> Send for CollectorSerializer<'a, C>
where C: Sync,

§

impl<'a, C> Sync for CollectorSerializer<'a, C>
where C: Sync,

§

impl<'a, C> Unpin for CollectorSerializer<'a, C>

§

impl<'a, C> UnwindSafe for CollectorSerializer<'a, C>
where C: RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> SendSyncUnwindSafe for T
where T: Send + Sync + UnwindSafe + ?Sized,