Enum vector_lib::event::Event
pub enum Event {
Log(LogEvent),
Metric(Metric),
Trace(TraceEvent),
}
Variants§
Implementations§
§impl Event
impl Event
pub 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
.
pub 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
.
pub 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
.
pub 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
.
pub 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
.
pub 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
.
pub 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
.
pub 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
.
pub 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
.
pub 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
.
pub 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
.
pub 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
.
pub 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
pub 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) -> Event
pub fn with_batch_notifier_option(self, batch: &Option<BatchNotifier>) -> Event
pub fn source_id(&self) -> Option<&Arc<ComponentKey>>
pub fn source_id(&self) -> Option<&Arc<ComponentKey>>
Returns a reference to the event metadata source.
pub 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.
pub 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.
pub 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.
pub fn with_source_id(self, source_id: Arc<ComponentKey>) -> Event
pub fn with_source_id(self, source_id: Arc<ComponentKey>) -> Event
Sets the source_id
in the event metadata to the provided value.
pub fn with_source_type(self, source_type: &'static str) -> Event
pub fn with_source_type(self, source_type: &'static str) -> Event
Sets the source_type
in the event metadata to the provided value.
pub fn with_upstream_id(self, upstream_id: Arc<OutputId>) -> Event
pub fn with_upstream_id(self, upstream_id: Arc<OutputId>) -> Event
Sets the upstream_id
in the event metadata to the provided value.
pub fn from_json_value(
value: Value,
log_namespace: LogNamespace,
) -> Result<Event, Box<dyn Error + Send + Sync>>
pub fn from_json_value( value: Value, log_namespace: LogNamespace, ) -> Result<Event, Box<dyn Error + Send + Sync>>
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§
§impl AddBatchNotifier for Event
impl AddBatchNotifier for Event
§fn add_batch_notifier(&mut self, batch: BatchNotifier)
fn add_batch_notifier(&mut self, batch: BatchNotifier)
§impl ByteSizeOf for Event
impl ByteSizeOf for Event
§impl<'de> Deserialize<'de> for Event
impl<'de> Deserialize<'de> for Event
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Event, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Event, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl EstimatedJsonEncodedSizeOf for Event
impl EstimatedJsonEncodedSizeOf for Event
fn estimated_json_encoded_size_of(&self) -> JsonSize
§impl EventContainer for Event
impl EventContainer for Event
§fn into_events(self) -> <Event as EventContainer>::IntoIter
fn into_events(self) -> <Event as EventContainer>::IntoIter
Event
.§impl EventCount for Event
impl EventCount for Event
fn event_count(&self) -> usize
§impl Finalizable for Event
impl Finalizable for Event
§fn take_finalizers(&mut self) -> EventFinalizers
fn take_finalizers(&mut self) -> EventFinalizers
§impl<'a> From<&'a mut Event> for EventMutRef<'a>
impl<'a> From<&'a mut Event> for EventMutRef<'a>
§fn from(event: &'a mut Event) -> EventMutRef<'a>
fn from(event: &'a mut Event) -> EventMutRef<'a>
§impl From<Event> for EventArray
impl From<Event> for EventArray
§fn from(event: Event) -> EventArray
fn from(event: Event) -> EventArray
§impl From<Event> for EventWrapper
impl From<Event> for EventWrapper
§fn from(event: Event) -> EventWrapper
fn from(event: Event) -> EventWrapper
§impl From<Event> for WithMetadata<Event>
impl From<Event> for WithMetadata<Event>
§fn from(event: Event) -> WithMetadata<Event>
fn from(event: Event) -> WithMetadata<Event>
§impl From<Event> for WithMetadata<EventWrapper>
impl From<Event> for WithMetadata<EventWrapper>
§fn from(event: Event) -> WithMetadata<EventWrapper>
fn from(event: Event) -> WithMetadata<EventWrapper>
§impl From<EventWrapper> for Event
impl From<EventWrapper> for Event
§fn from(proto: EventWrapper) -> Event
fn from(proto: EventWrapper) -> Event
§impl From<TraceEvent> for Event
impl From<TraceEvent> for Event
§fn from(trace: TraceEvent) -> Event
fn from(trace: TraceEvent) -> Event
§impl GetEventCountTags for Event
impl GetEventCountTags for Event
§impl MaybeAsLogMut for Event
impl MaybeAsLogMut for Event
fn maybe_as_log_mut(&mut self) -> Option<&mut LogEvent>
§impl Serialize for Event
impl Serialize for Event
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
§impl<T> TaskTransform<Event> for Twhere
T: RuntimeTransform + Send + 'static,
impl<T> TaskTransform<Event> for Twhere
T: RuntimeTransform + Send + 'static,
fn transform(
self: Box<T>,
input_rx: Pin<Box<dyn Stream<Item = Event> + Send>>,
) -> Pin<Box<dyn Stream<Item = Event> + Send>>where
T: '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