Skip to main content

FileLoggerFuncTrait

Trait FileLoggerFuncTrait 

Source
pub trait FileLoggerFuncTrait<T: AsRef<str>>:
    Fn(T) -> String
    + Send
    + Sync { }
Expand description

Trait for log formatting functions.

Defines the interface for functions that format log data. Implemented automatically for any compatible Fn(T) -> String.

§Generic Parameters

  • AsRef<str> - The type of data to be formatted, which will be converted to string slice.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<F, T> FileLoggerFuncTrait<T> for F
where F: Fn(T) -> String + Send + Sync, T: AsRef<str>,

Blanket implementation for any function matching FileLoggerFuncTrait signature.

This allows any compatible closure or function to be used as a log formatter.