Enum vector_core::event::Event
source · pub enum Event {
Log(LogEvent),
Metric(Metric),
Trace(TraceEvent),
}
Variants§
Implementations§
source§impl Event
impl Event
sourcepub fn as_log(&self) -> &LogEvent
pub fn as_log(&self) -> &LogEvent
Return self as a LogEvent
§Panics
This function panics if self is anything other than an Event::Log
.
sourcepub fn as_mut_log(&mut self) -> &mut LogEvent
pub fn as_mut_log(&mut self) -> &mut LogEvent
Return self as a mutable LogEvent
§Panics
This function panics if self is anything other than an Event::Log
.
sourcepub fn into_log(self) -> LogEvent
pub fn into_log(self) -> LogEvent
Coerces self into a LogEvent
§Panics
This function panics if self is anything other than an Event::Log
.
sourcepub fn try_into_log(self) -> Option<LogEvent>
pub fn try_into_log(self) -> Option<LogEvent>
Fallibly coerces self into a LogEvent
If the event is a LogEvent
, then Some(log_event)
is returned, otherwise None
.
sourcepub fn maybe_as_log(&self) -> Option<&LogEvent>
pub fn maybe_as_log(&self) -> Option<&LogEvent>
Return self as a LogEvent
if possible
If the event is a LogEvent
, then Some(&log_event)
is returned, otherwise None
.
sourcepub fn as_metric(&self) -> &Metric
pub fn as_metric(&self) -> &Metric
Return self as a Metric
§Panics
This function panics if self is anything other than an Event::Metric
.
sourcepub fn as_mut_metric(&mut self) -> &mut Metric
pub fn as_mut_metric(&mut self) -> &mut Metric
Return self as a mutable Metric
§Panics
This function panics if self is anything other than an Event::Metric
.
sourcepub fn into_metric(self) -> Metric
pub fn into_metric(self) -> Metric
Coerces self into Metric
§Panics
This function panics if self is anything other than an Event::Metric
.
sourcepub fn try_into_metric(self) -> Option<Metric>
pub fn try_into_metric(self) -> Option<Metric>
Fallibly coerces self into a Metric
If the event is a Metric
, then Some(metric)
is returned, otherwise None
.
sourcepub fn as_trace(&self) -> &TraceEvent
pub fn as_trace(&self) -> &TraceEvent
Return self as a TraceEvent
§Panics
This function panics if self is anything other than an Event::Trace
.
sourcepub fn as_mut_trace(&mut self) -> &mut TraceEvent
pub fn as_mut_trace(&mut self) -> &mut TraceEvent
Return self as a mutable TraceEvent
§Panics
This function panics if self is anything other than an Event::Trace
.
sourcepub fn into_trace(self) -> TraceEvent
pub fn into_trace(self) -> TraceEvent
Coerces self into a TraceEvent
§Panics
This function panics if self is anything other than an Event::Trace
.
sourcepub fn try_into_trace(self) -> Option<TraceEvent>
pub fn try_into_trace(self) -> Option<TraceEvent>
Fallibly coerces self into a TraceEvent
If the event is a TraceEvent
, then Some(trace)
is returned, otherwise None
.
pub fn metadata(&self) -> &EventMetadata
pub fn metadata_mut(&mut self) -> &mut EventMetadata
sourcepub fn into_metadata(self) -> EventMetadata
pub fn into_metadata(self) -> EventMetadata
Destroy the event and return the metadata.
pub fn with_batch_notifier(self, batch: &BatchNotifier) -> Self
pub fn with_batch_notifier_option(self, batch: &Option<BatchNotifier>) -> Self
sourcepub fn source_id(&self) -> Option<&Arc<ComponentKey>>
pub fn source_id(&self) -> Option<&Arc<ComponentKey>>
Returns a reference to the event metadata source.
sourcepub fn set_source_id(&mut self, source_id: Arc<ComponentKey>)
pub fn set_source_id(&mut self, source_id: Arc<ComponentKey>)
Sets the source_id
in the event metadata to the provided value.
sourcepub fn set_upstream_id(&mut self, upstream_id: Arc<OutputId>)
pub fn set_upstream_id(&mut self, upstream_id: Arc<OutputId>)
Sets the upstream_id
in the event metadata to the provided value.
sourcepub fn set_source_type(&mut self, source_type: &'static str)
pub fn set_source_type(&mut self, source_type: &'static str)
Sets the source_type
in the event metadata to the provided value.
sourcepub fn with_source_id(self, source_id: Arc<ComponentKey>) -> Self
pub fn with_source_id(self, source_id: Arc<ComponentKey>) -> Self
Sets the source_id
in the event metadata to the provided value.
sourcepub fn with_source_type(self, source_type: &'static str) -> Self
pub fn with_source_type(self, source_type: &'static str) -> Self
Sets the source_type
in the event metadata to the provided value.
sourcepub fn with_upstream_id(self, upstream_id: Arc<OutputId>) -> Self
pub fn with_upstream_id(self, upstream_id: Arc<OutputId>) -> Self
Sets the upstream_id
in the event metadata to the provided value.
sourcepub fn from_json_value(
value: Value,
log_namespace: LogNamespace,
) -> Result<Self>
pub fn from_json_value( value: Value, log_namespace: LogNamespace, ) -> Result<Self>
Creates an Event from a JSON value.
§Errors
If a non-object JSON value is passed in with the Legacy
namespace, this will return an error.
Trait Implementations§
source§impl AddBatchNotifier for Event
impl AddBatchNotifier for Event
source§fn add_batch_notifier(&mut self, batch: BatchNotifier)
fn add_batch_notifier(&mut self, batch: BatchNotifier)
source§impl<'de> Deserialize<'de> for Event
impl<'de> Deserialize<'de> for Event
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>,
source§impl EstimatedJsonEncodedSizeOf for Event
impl EstimatedJsonEncodedSizeOf for Event
fn estimated_json_encoded_size_of(&self) -> JsonSize
source§impl EventContainer for Event
impl EventContainer for Event
source§fn into_events(self) -> Self::IntoIter
fn into_events(self) -> Self::IntoIter
Event
.source§impl<'a> EventDataEq<Event> for EventRef<'a>
impl<'a> EventDataEq<Event> for EventRef<'a>
fn event_data_eq(&self, that: &Event) -> bool
source§impl Finalizable for Event
impl Finalizable for Event
source§fn take_finalizers(&mut self) -> EventFinalizers
fn take_finalizers(&mut self) -> EventFinalizers
source§impl<'a> From<&'a mut Event> for EventMutRef<'a>
impl<'a> From<&'a mut Event> for EventMutRef<'a>
source§impl From<Event> for EventArray
impl From<Event> for EventArray
source§impl From<Event> for EventWrapper
impl From<Event> for EventWrapper
source§impl From<Event> for WithMetadata<EventWrapper>
impl From<Event> for WithMetadata<EventWrapper>
source§impl From<EventWrapper> for Event
impl From<EventWrapper> for Event
source§fn from(proto: EventWrapper) -> Self
fn from(proto: EventWrapper) -> Self
source§impl From<TraceEvent> for Event
impl From<TraceEvent> for Event
source§fn from(trace: TraceEvent) -> Self
fn from(trace: TraceEvent) -> Self
source§impl MaybeAsLogMut for Event
impl MaybeAsLogMut for Event
fn maybe_as_log_mut(&mut self) -> Option<&mut LogEvent>
source§impl PartialEq for Event
impl PartialEq for Event
source§impl<T> TaskTransform<Event> for Twhere
T: RuntimeTransform + Send + 'static,
impl<T> TaskTransform<Event> for Twhere
T: RuntimeTransform + Send + 'static,
impl StructuralPartialEq for Event
Auto Trait Implementations§
impl Freeze for Event
impl !RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl !UnwindSafe for Event
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
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>
§impl<T> FromLuaMulti for Twhere
T: FromLua,
impl<T> FromLuaMulti for Twhere
T: FromLua,
§fn from_lua_multi(values: MultiValue, lua: &Lua) -> Result<T, Error>
fn from_lua_multi(values: MultiValue, lua: &Lua) -> Result<T, Error>
fn from_lua_args( args: MultiValue, i: usize, to: Option<&str>, lua: &Lua, ) -> Result<T, Error>
unsafe fn from_stack_multi(nvals: i32, lua: &RawLua) -> Result<T, Error>
unsafe fn from_stack_args( nargs: i32, i: usize, to: Option<&str>, lua: &RawLua, ) -> Result<T, Error>
§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>
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>
§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>
§fn octets_into(self) -> Targetwhere
Self::Error: Into<Infallible>,
fn octets_into(self) -> Targetwhere
Self::Error: Into<Infallible>,
§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,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
§fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
§fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
§fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
§fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
§fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
§fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
§fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
§fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
§fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
§fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
§fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
§fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
§fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
§fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
§fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
§fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
§fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
§fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
§fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
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,
OwoColorize::bg
or
a color-specific method, such as OwoColorize::on_yellow
, Read more