pub trait ClientLogFormatter:
Send
+ Sync
+ 'static {
type Output: Display + Send + Sync + 'static;
// Required method
fn format(&self, conn: &Conn, color: bool) -> Self::Output;
}Available on crate feature
client only.Expand description
The interface to format a client::Conn as a Display-able output.
Mirrors the server-side LogFormatter trait, but takes a
trillium_client::Conn rather than a trillium::Conn.
§Implementations
ClientLogFormatter is implemented for:
- all 2-26-arity tuples of
ClientLogFormatters, output concatenated with no separator &'static strandArc<str>, for interspersing static textFn(&Conn, bool) -> impl Display, the most common way to write a custom formatter
use std::borrow::Cow;
use trillium_client::Conn;
use trillium_logger::client::{ClientLogger, formatters};
fn marker(_conn: &Conn, _color: bool) -> Cow<'static, str> {
"[client] ".into()
}
ClientLogger::new().with_formatter((marker, formatters::method, " ", formatters::url));Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".