Trait log::kv::value::Visit

source ·
pub trait Visit<'v> {
    // Required method
    fn visit_any(&mut self, value: Value<'_>) -> Result<(), Error>;

    // Provided methods
    fn visit_u64(&mut self, value: u64) -> Result<(), Error> { ... }
    fn visit_i64(&mut self, value: i64) -> Result<(), Error> { ... }
    fn visit_u128(&mut self, value: u128) -> Result<(), Error> { ... }
    fn visit_i128(&mut self, value: i128) -> Result<(), Error> { ... }
    fn visit_f64(&mut self, value: f64) -> Result<(), Error> { ... }
    fn visit_bool(&mut self, value: bool) -> Result<(), Error> { ... }
    fn visit_str(&mut self, value: &str) -> Result<(), Error> { ... }
    fn visit_borrowed_str(&mut self, value: &'v str) -> Result<(), Error> { ... }
    fn visit_char(&mut self, value: char) -> Result<(), Error> { ... }
}
Expand description

A visitor for a Value.

Required Methods§

source

fn visit_any(&mut self, value: Value<'_>) -> Result<(), Error>

Visit a Value.

This is the only required method on Visit and acts as a fallback for any more specific methods that aren’t overridden. The Value may be formatted using its fmt::Debug or fmt::Display implementation, or serialized using its sval::Value or serde::Serialize implementation.

Provided Methods§

source

fn visit_u64(&mut self, value: u64) -> Result<(), Error>

Visit an unsigned integer.

source

fn visit_i64(&mut self, value: i64) -> Result<(), Error>

Visit a signed integer.

source

fn visit_u128(&mut self, value: u128) -> Result<(), Error>

Visit a big unsigned integer.

source

fn visit_i128(&mut self, value: i128) -> Result<(), Error>

Visit a big signed integer.

source

fn visit_f64(&mut self, value: f64) -> Result<(), Error>

Visit a floating point.

source

fn visit_bool(&mut self, value: bool) -> Result<(), Error>

Visit a boolean.

source

fn visit_str(&mut self, value: &str) -> Result<(), Error>

Visit a string.

source

fn visit_borrowed_str(&mut self, value: &'v str) -> Result<(), Error>

Visit a string.

source

fn visit_char(&mut self, value: char) -> Result<(), Error>

Visit a Unicode character.

Implementations on Foreign Types§

source§

impl<'a, 'v, T> Visit<'v> for &'a mut T
where T: Visit<'v> + ?Sized,

source§

fn visit_any(&mut self, value: Value<'_>) -> Result<(), Error>

source§

fn visit_u64(&mut self, value: u64) -> Result<(), Error>

source§

fn visit_i64(&mut self, value: i64) -> Result<(), Error>

source§

fn visit_u128(&mut self, value: u128) -> Result<(), Error>

source§

fn visit_i128(&mut self, value: i128) -> Result<(), Error>

source§

fn visit_f64(&mut self, value: f64) -> Result<(), Error>

source§

fn visit_bool(&mut self, value: bool) -> Result<(), Error>

source§

fn visit_str(&mut self, value: &str) -> Result<(), Error>

source§

fn visit_borrowed_str(&mut self, value: &'v str) -> Result<(), Error>

source§

fn visit_char(&mut self, value: char) -> Result<(), Error>

Implementors§