Struct timely::logging_core::Registry [−][src]
Implementations
impl<Id> Registry<Id> where
Id: 'static + Clone,
[src]
Id: 'static + Clone,
pub fn insert<T, F>(
&mut self,
name: &str,
action: F
) -> Option<Box<dyn Any + 'static, Global>> where
T: 'static,
F: 'static + FnMut(&Duration, &mut Vec<(Duration, Id, T), Global>),
[src]
&mut self,
name: &str,
action: F
) -> Option<Box<dyn Any + 'static, Global>> where
T: 'static,
F: 'static + FnMut(&Duration, &mut Vec<(Duration, Id, T), Global>),
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 insert_logger<T>(
&mut self,
name: &str,
logger: Logger<T, Id>
) -> Option<Box<dyn Any + 'static, Global>> where
T: 'static,
[src]
&mut self,
name: &str,
logger: Logger<T, Id>
) -> Option<Box<dyn Any + 'static, Global>> where
T: 'static,
Binds a log name to a logger.
pub fn remove(&mut self, name: &str) -> Option<Box<dyn Any + 'static, Global>>
[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>(&self, name: &str) -> Option<Logger<T, Id>> where
T: 'static,
[src]
T: 'static,
Retrieves a shared logger, if one has been inserted.
pub fn new(time: Instant, id: Id) -> Registry<Id>
[src]
Creates a new logger registry.
pub fn flush(&mut self)
[src]
Flushes all registered logs.
Auto Trait Implementations
impl<Id> !RefUnwindSafe for Registry<Id>
impl<Id> !Send for Registry<Id>
impl<Id> !Sync for Registry<Id>
impl<Id> Unpin for Registry<Id> where
Id: Unpin,
Id: Unpin,
impl<Id> !UnwindSafe for Registry<Id>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,