Struct vector_core::event::TraceEvent
source · pub struct TraceEvent(/* private fields */);
Expand description
Traces are a newtype of LogEvent
Implementations§
source§impl TraceEvent
impl TraceEvent
sourcepub fn into_parts(self) -> (ObjectMap, EventMetadata)
pub fn into_parts(self) -> (ObjectMap, EventMetadata)
Convert a TraceEvent
into a tuple of its components
§Panics
Panics if the fields of the TraceEvent
are not a Value::Map
.
pub fn from_parts(fields: ObjectMap, metadata: EventMetadata) -> Self
pub fn value(&self) -> &Value
pub fn value_mut(&mut self) -> &mut Value
pub fn metadata(&self) -> &EventMetadata
pub fn metadata_mut(&mut self) -> &mut EventMetadata
pub fn add_finalizer(&mut self, finalizer: EventFinalizer)
pub fn with_batch_notifier(self, batch: &BatchNotifier) -> Self
pub fn with_batch_notifier_option(self, batch: &Option<BatchNotifier>) -> Self
sourcepub fn as_map(&self) -> &ObjectMap
pub fn as_map(&self) -> &ObjectMap
Convert a TraceEvent
into an ObjectMap
of it’s fields
§Panics
Panics if the fields of the TraceEvent
are not a Value::Map
.
sourcepub fn parse_path_and_get_value(
&self,
path: impl AsRef<str>,
) -> Result<Option<&Value>, PathParseError>
pub fn parse_path_and_get_value( &self, path: impl AsRef<str>, ) -> Result<Option<&Value>, PathParseError>
Parse the specified path
and if there are no parsing errors, attempt to get a reference to a value.
§Errors
Will return an error if path parsing failed.
pub fn get<'a>(&self, key: impl TargetPath<'a>) -> Option<&Value>
pub fn get_mut<'a>(&mut self, key: impl TargetPath<'a>) -> Option<&mut Value>
pub fn contains<'a>(&self, key: impl TargetPath<'a>) -> bool
pub fn insert<'a>( &mut self, key: impl TargetPath<'a>, value: impl Into<Value> + Debug, ) -> Option<Value>
pub fn maybe_insert<'a, F: FnOnce() -> Value>( &mut self, path: Option<impl TargetPath<'a>>, value_callback: F, ) -> Option<Value>
pub fn remove<'a>(&mut self, key: impl TargetPath<'a>) -> Option<Value>
Trait Implementations§
source§impl AsMut<LogEvent> for TraceEvent
impl AsMut<LogEvent> for TraceEvent
source§impl AsRef<LogEvent> for TraceEvent
impl AsRef<LogEvent> for TraceEvent
source§impl ByteSizeOf for TraceEvent
impl ByteSizeOf for TraceEvent
source§impl Clone for TraceEvent
impl Clone for TraceEvent
source§fn clone(&self) -> TraceEvent
fn clone(&self) -> TraceEvent
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for TraceEvent
impl Debug for TraceEvent
source§impl Default for TraceEvent
impl Default for TraceEvent
source§fn default() -> TraceEvent
fn default() -> TraceEvent
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for TraceEvent
impl<'de> Deserialize<'de> for TraceEvent
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl EstimatedJsonEncodedSizeOf for TraceEvent
impl EstimatedJsonEncodedSizeOf for TraceEvent
fn estimated_json_encoded_size_of(&self) -> JsonSize
source§impl EventCount for TraceEvent
impl EventCount for TraceEvent
fn event_count(&self) -> usize
source§impl EventDataEq for TraceEvent
impl EventDataEq for TraceEvent
fn event_data_eq(&self, other: &Self) -> bool
source§impl Finalizable for TraceEvent
impl Finalizable for TraceEvent
source§fn take_finalizers(&mut self) -> EventFinalizers
fn take_finalizers(&mut self) -> EventFinalizers
Consumes the finalizers of this object. Read more
source§impl<'a> From<&'a TraceEvent> for EventRef<'a>
impl<'a> From<&'a TraceEvent> for EventRef<'a>
source§fn from(trace: &'a TraceEvent) -> Self
fn from(trace: &'a TraceEvent) -> Self
Converts to this type from the input type.
source§impl<'a> From<&'a mut TraceEvent> for EventMutRef<'a>
impl<'a> From<&'a mut TraceEvent> for EventMutRef<'a>
source§fn from(trace: &'a mut TraceEvent) -> Self
fn from(trace: &'a mut TraceEvent) -> Self
Converts to this type from the input type.
source§impl From<LogEvent> for TraceEvent
impl From<LogEvent> for TraceEvent
source§impl From<Trace> for TraceEvent
impl From<Trace> for TraceEvent
source§impl From<TraceEvent> for Event
impl From<TraceEvent> for Event
source§fn from(trace: TraceEvent) -> Self
fn from(trace: TraceEvent) -> Self
Converts to this type from the input type.
source§impl From<TraceEvent> for EventArray
impl From<TraceEvent> for EventArray
source§fn from(trace: TraceEvent) -> Self
fn from(trace: TraceEvent) -> Self
Converts to this type from the input type.
source§impl From<TraceEvent> for Trace
impl From<TraceEvent> for Trace
source§fn from(trace: TraceEvent) -> Self
fn from(trace: TraceEvent) -> Self
Converts to this type from the input type.
source§impl From<TraceEvent> for WithMetadata<Trace>
impl From<TraceEvent> for WithMetadata<Trace>
source§fn from(trace: TraceEvent) -> Self
fn from(trace: TraceEvent) -> Self
Converts to this type from the input type.
source§impl GetEventCountTags for TraceEvent
impl GetEventCountTags for TraceEvent
source§impl PartialEq for TraceEvent
impl PartialEq for TraceEvent
source§impl Serialize for TraceEvent
impl Serialize for TraceEvent
impl StructuralPartialEq for TraceEvent
Auto Trait Implementations§
impl Freeze for TraceEvent
impl !RefUnwindSafe for TraceEvent
impl Send for TraceEvent
impl Sync for TraceEvent
impl Unpin for TraceEvent
impl !UnwindSafe for TraceEvent
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§fn deserialize(
&self,
deserializer: &mut D,
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.
§impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
type Error = <Target as OctetsFrom<Source>>::Error
§fn try_octets_into(
self,
) -> Result<Target, <Source as OctetsInto<Target>>::Error>
fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>
Performs the conversion.
§fn octets_into(self) -> Targetwhere
Self::Error: Into<Infallible>,
fn octets_into(self) -> Targetwhere
Self::Error: Into<Infallible>,
Performs an infallible conversion.
§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Set the foreground color generically Read more
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Set the background color generically. Read more
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Change the background color to magenta
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Change the foreground color to the terminal default
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Change the background color to the terminal default
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Change the foreground color to bright black
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Change the background color to bright black
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Change the foreground color to bright red
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Change the background color to bright red
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Change the foreground color to bright green
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Change the background color to bright green
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Change the foreground color to bright yellow
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Change the background color to bright yellow
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Change the foreground color to bright blue
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Change the background color to bright blue
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Change the foreground color to bright magenta
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Change the background color to bright magenta
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Change the foreground color to bright purple
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Change the background color to bright purple
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Change the foreground color to bright cyan
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Change the background color to bright cyan
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Change the foreground color to bright white
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Change the background color to bright white
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Make the text blink (but fast!)
Hide the text
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Cross out the text
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
Set the foreground color at runtime. Only use if you do not know which color will be used at
compile-time. If the color is constant, use either [
OwoColorize::fg
] or
a color-specific method, such as [OwoColorize::green
], Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
Set the background color at runtime. Only use if you do not know what color to use at
compile-time. If the color is constant, use either [
OwoColorize::bg
] or
a color-specific method, such as [OwoColorize::on_yellow
], Read more§fn fg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
Set the foreground color to a specific RGB value.
§fn bg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
Set the background color to a specific RGB value.
§fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
Sets the foreground color to an RGB value.
§fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
Sets the background color to an RGB value.
§fn if_supports_color<'a, Out, ApplyFn>(
&'a self,
stream: impl Into<Stream>,
apply: ApplyFn,
) -> SupportsColorsDisplay<'a, Self, Out, ApplyFn>where
ApplyFn: Fn(&'a Self) -> Out,
fn if_supports_color<'a, Out, ApplyFn>(
&'a self,
stream: impl Into<Stream>,
apply: ApplyFn,
) -> SupportsColorsDisplay<'a, Self, Out, ApplyFn>where
ApplyFn: Fn(&'a Self) -> Out,
Apply a given transformation function to all formatters if the given stream
supports at least basic ANSI colors, allowing you to conditionally apply
given styles/colors. Read more