#[non_exhaustive]pub struct TimeEvent {
pub time: Option<Timestamp>,
pub value: Option<Value>,
}Expand description
A time-stamped annotation or message event in the Span.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.time: Option<Timestamp>The timestamp indicating the time the event occurred.
value: Option<Value>A TimeEvent can contain either an Annotation object or a
MessageEvent object, but not both.
Implementations§
Source§impl TimeEvent
impl TimeEvent
Sourcepub fn get_annotation(&self) -> Option<&Box<Annotation>>
pub fn get_annotation(&self) -> Option<&Box<Annotation>>
The value of value
if it holds a Annotation, None if the field is not set or
holds a different branch.
Sourcepub fn get_message_event(&self) -> Option<&Box<MessageEvent>>
pub fn get_message_event(&self) -> Option<&Box<MessageEvent>>
The value of value
if it holds a MessageEvent, None if the field is not set or
holds a different branch.
Sourcepub fn set_annotation<T: Into<Box<Annotation>>>(self, v: T) -> Self
pub fn set_annotation<T: Into<Box<Annotation>>>(self, v: T) -> Self
Sets the value of value
to hold a Annotation.
Note that all the setters affecting value are
mutually exclusive.
Sourcepub fn set_message_event<T: Into<Box<MessageEvent>>>(self, v: T) -> Self
pub fn set_message_event<T: Into<Box<MessageEvent>>>(self, v: T) -> Self
Sets the value of value
to hold a MessageEvent.
Note that all the setters affecting value are
mutually exclusive.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TimeEvent
impl<'de> Deserialize<'de> for TimeEvent
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
impl StructuralPartialEq for TimeEvent
Auto Trait Implementations§
impl Freeze for TimeEvent
impl RefUnwindSafe for TimeEvent
impl Send for TimeEvent
impl Sync for TimeEvent
impl Unpin for TimeEvent
impl UnwindSafe for TimeEvent
Blanket Implementations§
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