#[non_exhaustive]pub struct TimeEvent {
pub time: Option<Timestamp>,
pub value: Option<Value>,
/* private fields */
}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
pub fn new() -> Self
Sourcepub fn set_or_clear_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of time.
Sourcepub fn set_value<T: Into<Option<Value>>>(self, v: T) -> Self
pub fn set_value<T: Into<Option<Value>>>(self, v: T) -> Self
Sets the value of value.
Note that all the setters affecting value are mutually
exclusive.
Sourcepub fn annotation(&self) -> Option<&Box<Annotation>>
pub fn 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 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 message_event(&self) -> Option<&Box<MessageEvent>>
pub fn 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_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§
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