[−][src]Struct fern::FormatCallback
Callback struct for use within a formatter closure
Callbacks are used for formatting in order to allow usage of
std::fmt
-based formatting without the allocation of the formatted
result which would be required to return it.
Example usage:
fern::Dispatch::new().format(|callback: fern::FormatCallback, message, record| { callback.finish(format_args!("[{}] {}", record.level(), message)) })
Methods
impl<'a> FormatCallback<'a>
[src]
pub fn finish(self, formatted_message: Arguments)
[src]
Complete the formatting call that this FormatCallback was created for.
This will call the rest of the logging chain using the given formatted message as the new payload message.
Example usage:
callback.finish(format_args!("[{}] {}", record.level(), message))
See format_args!
.
Auto Trait Implementations
impl<'a> !Send for FormatCallback<'a>
impl<'a> !Sync for FormatCallback<'a>
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,