[−][src]Struct timely_logging::Registry
Methods
impl<Id: Clone + 'static> Registry<Id>
[src]
pub fn insert<T: 'static, F: FnMut(&Duration, &mut Vec<(Duration, Id, T)>) + 'static>(
&mut self,
name: &str,
action: F
) -> Option<Box<dyn Any>>
[src]
&mut self,
name: &str,
action: F
) -> Option<Box<dyn Any>>
Binds a log name to an action on log event batches.
This method also returns any pre-installed action, rather than overwriting it and pivoting the logging destination mid-stream. New loggers with this name will use the new destination, and existing loggers will use the old destination.
The action should respond to a sequence of events with non-decreasing timestamps
(Durations) and well as a timestamp that lower bounds the next event that could be
seen (likely greater or equal to the timestamp of the last event). The end of a
logging stream is indicated only by dropping the associated action, which can be
accomplished with remove
(or a call to insert, though this is not recommended).
pub fn remove(&mut self, name: &str) -> Option<Box<dyn Any>>
[src]
Removes a bound logger.
This is intended primarily to close a logging stream and let the associated writer communicate that the stream is closed to any consumers. If a binding is not removed, then the stream cannot be complete as in principle anyone could acquire a handle to the logger and start further logging.
pub fn get<T: 'static>(&self, name: &str) -> Option<Logger<T, Id>>
[src]
Retrieves a shared logger, if one has been inserted.
pub fn new(time: Instant, id: Id) -> Self
[src]
Creates a new logger registry.
pub fn flush(&mut self)
[src]
Flushes all registered logs.
Auto Trait Implementations
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>,