mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-07 00:00:08 +02:00
trace-core: API polish (#962)
This branch makes a handful of `tokio-trace-core` API improvements, mostly around naming. In particular: * Rename `dispatcher::with` to `dispatcher::get_default` * Rename `Event::observe` to `Event::dispatch` * Make `field::ValidLen` trait private Closes #948 Closes #960 Signed-off-by: Eliza Weisman <[email protected]>
This commit is contained in:
@@ -27,9 +27,9 @@ impl<'a> Event<'a> {
|
||||
/// Constructs a new `Event` with the specified metadata and set of values,
|
||||
/// and observes it with the current subscriber.
|
||||
#[inline]
|
||||
pub fn observe(metadata: &'a Metadata<'a>, fields: &'a field::ValueSet) {
|
||||
pub fn dispatch(metadata: &'a Metadata<'a>, fields: &'a field::ValueSet) {
|
||||
let event = Event { metadata, fields };
|
||||
::dispatcher::with(|current| {
|
||||
::dispatcher::get_default(|current| {
|
||||
current.event(&event);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user