Enum vector_core::event::Event

source ·
pub enum Event {
    Log(LogEvent),
    Metric(Metric),
    Trace(TraceEvent),
}

Variants§

§

Log(LogEvent)

§

Metric(Metric)

§

Trace(TraceEvent)

Implementations§

source§

impl Event

source

pub fn as_log(&self) -> &LogEvent

Return self as a LogEvent

§Panics

This function panics if self is anything other than an Event::Log.

source

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.

source

pub fn into_log(self) -> LogEvent

Coerces self into a LogEvent

§Panics

This function panics if self is anything other than an Event::Log.

source

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.

source

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.

source

pub fn as_metric(&self) -> &Metric

Return self as a Metric

§Panics

This function panics if self is anything other than an Event::Metric.

source

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.

source

pub fn into_metric(self) -> Metric

Coerces self into Metric

§Panics

This function panics if self is anything other than an Event::Metric.

source

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.

source

pub fn as_trace(&self) -> &TraceEvent

Return self as a TraceEvent

§Panics

This function panics if self is anything other than an Event::Trace.

source

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.

source

pub fn into_trace(self) -> TraceEvent

Coerces self into a TraceEvent

§Panics

This function panics if self is anything other than an Event::Trace.

source

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.

source

pub fn metadata(&self) -> &EventMetadata

source

pub fn metadata_mut(&mut self) -> &mut EventMetadata

source

pub fn into_metadata(self) -> EventMetadata

Destroy the event and return the metadata.

source

pub fn with_batch_notifier(self, batch: &BatchNotifier) -> Self

source

pub fn with_batch_notifier_option(self, batch: &Option<BatchNotifier>) -> Self

source

pub fn source_id(&self) -> Option<&Arc<ComponentKey>>

Returns a reference to the event metadata source.

source

pub fn set_source_id(&mut self, source_id: Arc<ComponentKey>)

Sets the source_id in the event metadata to the provided value.

source

pub fn set_upstream_id(&mut self, upstream_id: Arc<OutputId>)

Sets the upstream_id in the event metadata to the provided value.

source

pub fn set_source_type(&mut self, source_type: &'static str)

Sets the source_type in the event metadata to the provided value.

source

pub fn with_source_id(self, source_id: Arc<ComponentKey>) -> Self

Sets the source_id in the event metadata to the provided value.

source

pub fn with_source_type(self, source_type: &'static str) -> Self

Sets the source_type in the event metadata to the provided value.

source

pub fn with_upstream_id(self, upstream_id: Arc<OutputId>) -> Self

Sets the upstream_id in the event metadata to the provided value.

source

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

source§

fn add_batch_notifier(&mut self, batch: BatchNotifier)

Adds a single shared batch notifier to this type.
source§

impl ByteSizeOf for Event

source§

fn allocated_bytes(&self) -> usize

Returns the allocated bytes of this type Read more
§

fn size_of(&self) -> usize

Returns the in-memory size of this type Read more
source§

impl Clone for Event

source§

fn clone(&self) -> Event

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Event

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Event

source§

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 Event

source§

impl EventContainer for Event

§

type IntoIter = Once<Event>

The type of Iterator used to turn this container into events.
source§

fn len(&self) -> usize

The number of events in this container.
source§

fn is_empty(&self) -> bool

Is this container empty?
source§

fn into_events(self) -> Self::IntoIter

Turn this container into an iterator over Event.
source§

impl EventCount for Event

source§

impl<'a> EventDataEq<Event> for EventRef<'a>

source§

fn event_data_eq(&self, that: &Event) -> bool

source§

impl EventDataEq for Event

source§

fn event_data_eq(&self, other: &Self) -> bool

source§

impl Finalizable for Event

source§

fn take_finalizers(&mut self) -> EventFinalizers

Consumes the finalizers of this object. Read more
source§

impl<'a> From<&'a Event> for EventRef<'a>

source§

fn from(event: &'a Event) -> Self

Converts to this type from the input type.
source§

impl<'a> From<&'a mut Event> for EventMutRef<'a>

source§

fn from(event: &'a mut Event) -> Self

Converts to this type from the input type.
source§

impl From<Event> for Event

source§

fn from(event: Event) -> Self

Converts to this type from the input type.
source§

impl From<Event> for EventArray

source§

fn from(event: Event) -> Self

Converts to this type from the input type.
source§

impl From<Event> for EventWrapper

source§

fn from(event: Event) -> Self

Converts to this type from the input type.
source§

impl From<Event> for WithMetadata<Event>

source§

fn from(event: Event) -> Self

Converts to this type from the input type.
source§

impl From<Event> for WithMetadata<EventWrapper>

source§

fn from(event: Event) -> Self

Converts to this type from the input type.
source§

impl From<EventWrapper> for Event

source§

fn from(proto: EventWrapper) -> Self

Converts to this type from the input type.
source§

impl From<LogEvent> for Event

source§

fn from(log: LogEvent) -> Self

Converts to this type from the input type.
source§

impl From<Metric> for Event

source§

fn from(metric: Metric) -> Self

Converts to this type from the input type.
source§

impl From<TraceEvent> for Event

source§

fn from(trace: TraceEvent) -> Self

Converts to this type from the input type.
source§

impl<'a> FromLua<'a> for Event

source§

fn from_lua(value: LuaValue<'a>, lua: &'a Lua) -> LuaResult<Self>

Performs the conversion.
source§

impl GetEventCountTags for Event

source§

fn get_tags(&self) -> TaggedEventsSent

source§

impl MaybeAsLogMut for Event

source§

impl PartialEq for Event

source§

fn eq(&self, other: &Event) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Event

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<T> TaskTransform<Event> for T
where T: RuntimeTransform + Send + 'static,

source§

fn transform( self: Box<Self>, input_rx: Pin<Box<dyn Stream<Item = Event> + Send>>, ) -> Pin<Box<dyn Stream<Item = Event> + Send>>
where Self: 'static,

source§

fn transform_events( self: Box<Self>, task: Pin<Box<dyn Stream<Item = Event> + Send>>, ) -> Pin<Box<dyn Stream<Item = Event> + Send>>
where T: From<Event>, T::IntoIter: Send,

Wrap the transform task to process and emit individual events. This is used to simplify testing task transforms.
source§

impl TryInto<Value> for Event

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<Value, Self::Error>

Performs the conversion.
source§

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§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

§

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
source§

impl<T> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<'lua, T> FromLuaMulti<'lua> for T
where T: FromLua<'lua>,

§

fn from_lua_multi(values: MultiValue<'lua>, lua: &'lua Lua) -> Result<T, Error>

Performs the conversion. Read more
§

fn from_lua_args( args: MultiValue<'lua>, i: usize, to: Option<&str>, lua: &'lua Lua, ) -> Result<T, Error>

§

unsafe fn from_stack_multi(nvals: i32, lua: &'lua Lua) -> Result<T, Error>

§

unsafe fn from_stack_args( nargs: i32, i: usize, to: Option<&str>, lua: &'lua Lua, ) -> Result<T, Error>

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> LayoutRaw for T

§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Gets the layout of the type.
§

impl<Source, Target> OctetsInto<Target> for Source
where Target: OctetsFrom<Source>,

§

type Error = <Target as OctetsFrom<Source>>::Error

§

fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>

Performs the conversion.
§

fn octets_into(self) -> Target
where Self::Error: Into<Infallible>,

Performs an infallible conversion.
§

impl<D> OwoColorize for D

§

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,

Set the background color generically. Read more
§

fn black<'a>(&'a self) -> FgColorDisplay<'a, Black, Self>

Change the foreground color to black
§

fn on_black<'a>(&'a self) -> BgColorDisplay<'a, Black, Self>

Change the background color to black
§

fn red<'a>(&'a self) -> FgColorDisplay<'a, Red, Self>

Change the foreground color to red
§

fn on_red<'a>(&'a self) -> BgColorDisplay<'a, Red, Self>

Change the background color to red
§

fn green<'a>(&'a self) -> FgColorDisplay<'a, Green, Self>

Change the foreground color to green
§

fn on_green<'a>(&'a self) -> BgColorDisplay<'a, Green, Self>

Change the background color to green
§

fn yellow<'a>(&'a self) -> FgColorDisplay<'a, Yellow, Self>

Change the foreground color to yellow
§

fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>

Change the background color to yellow
§

fn blue<'a>(&'a self) -> FgColorDisplay<'a, Blue, Self>

Change the foreground color to blue
§

fn on_blue<'a>(&'a self) -> BgColorDisplay<'a, Blue, Self>

Change the background color to blue
§

fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>

Change the foreground color to magenta
§

fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>

Change the background color to magenta
§

fn purple<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>

Change the foreground color to purple
§

fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>

Change the background color to purple
§

fn cyan<'a>(&'a self) -> FgColorDisplay<'a, Cyan, Self>

Change the foreground color to cyan
§

fn on_cyan<'a>(&'a self) -> BgColorDisplay<'a, Cyan, Self>

Change the background color to cyan
§

fn white<'a>(&'a self) -> FgColorDisplay<'a, White, Self>

Change the foreground color to white
§

fn on_white<'a>(&'a self) -> BgColorDisplay<'a, White, Self>

Change the background color to white
§

fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>

Change the foreground color to the terminal default
§

fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>

Change the background color to the terminal default
§

fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>

Change the foreground color to bright black
§

fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>

Change the background color to bright black
§

fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>

Change the foreground color to bright red
§

fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>

Change the background color to bright red
§

fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>

Change the foreground color to bright green
§

fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>

Change the background color to bright green
§

fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>

Change the foreground color to bright yellow
§

fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>

Change the background color to bright yellow
§

fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>

Change the foreground color to bright blue
§

fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>

Change the background color to bright blue
§

fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>

Change the foreground color to bright magenta
§

fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>

Change the background color to bright magenta
§

fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>

Change the foreground color to bright purple
§

fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>

Change the background color to bright purple
§

fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>

Change the foreground color to bright cyan
§

fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>

Change the background color to bright cyan
§

fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>

Change the foreground color to bright white
§

fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>

Change the background color to bright white
§

fn bold<'a>(&'a self) -> BoldDisplay<'a, Self>

Make the text bold
§

fn dimmed<'a>(&'a self) -> DimDisplay<'a, Self>

Make the text dim
§

fn italic<'a>(&'a self) -> ItalicDisplay<'a, Self>

Make the text italicized
§

fn underline<'a>(&'a self) -> UnderlineDisplay<'a, Self>

Make the text italicized
Make the text blink
Make the text blink (but fast!)
§

fn reversed<'a>(&'a self) -> ReversedDisplay<'a, Self>

Swap the foreground and background colors
§

fn hidden<'a>(&'a self) -> HiddenDisplay<'a, Self>

Hide the text
§

fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>

Cross out the text
§

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,

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>

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>

Set the background color to a specific RGB value.
§

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>

Sets the background color to an RGB value.
§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Metadata = ()

The type for metadata in pointers and references to Self.
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<T> InMemoryBufferable for T
where T: AddBatchNotifier + ByteSizeOf + EventCount + Debug + Send + Sync + Unpin + 'static,