.
//
//!
//! # Mock Formatter
//!
use ::fmt;
use crate::FormatTrait;
///
/// Mock Formatter.
///
/// Used as a filler. It does not have a proper format string. It is also used
/// in examples for custom formatters.
///
#[derive(,,,,)]
pub struct MockFormatter {
dt_fmt:
fmt_string:
}
impl MockFormatter {
///
/// Creates a new instance of `MockFormatter`.
///
pub fn new() -> Self {
Self {
: ""to_string(),
: "MockFormatter"to_string(),
}
}
///
/// Returns the date/time format string.
///
pub fn dt_fmt(&self) -> {
selfclone()
}
///
/// Returns the primary format string.
///
pub fn fmt_string(&self) -> {
selfclone()
}
}
impl for MockFormatter {
fn default() -> Self {
Self::()
}
}
impl ::for MockFormatter {
fn fmt(&selff: &mut ::<_>) -> :: {
write!( "{}", selffmt_string())
}
}
impl for MockFormatter {
fn format(&self_log_entry: &::) -> {
let _ = selfdt_fmt();
"MockFormatter"to_string()
}
}