Struct slog_term::Serializer

source ·
pub struct Serializer<'a> { /* private fields */ }
Expand description

Serializer for the lines

Implementations§

source§

impl<'a> Serializer<'a>

source

pub fn new( d: &'a mut dyn RecordDecorator, comma_needed: bool, reverse: bool ) -> Self

Create Serializer instance

source

pub fn finish(self) -> Result<()>

Write out all the whole stack

Trait Implementations§

source§

impl<'a> Drop for Serializer<'a>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<'a> Serializer for Serializer<'a>

source§

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

Emit None
source§

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

Emit ()
source§

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

Emit bool
source§

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

Emit char
source§

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

Emit usize
source§

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

Emit isize
source§

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

Emit u8
source§

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

Emit i8
source§

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

Emit u16
source§

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

Emit i16
source§

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

Emit u32
source§

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

Emit i32
source§

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

Emit f32
source§

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

Emit u64
source§

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

Emit i64
source§

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

Emit f64
source§

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

Emit &str
source§

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

Emit fmt::Arguments Read more
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_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> !RefUnwindSafe for Serializer<'a>

§

impl<'a> !Send for Serializer<'a>

§

impl<'a> !Sync for Serializer<'a>

§

impl<'a> Unpin for Serializer<'a>

§

impl<'a> !UnwindSafe for Serializer<'a>

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.