pub struct RuntimeEventRef<'a> { /* private fields */ }Expand description
One event of a RuntimeEventBatch, read from runtime-owned storage.
Implementations§
Source§impl<'a> RuntimeEventRef<'a>
impl<'a> RuntimeEventRef<'a>
Sourcepub fn event_type(&self) -> RuntimeEventType
pub fn event_type(&self) -> RuntimeEventType
Returns this event’s type.
Sourcepub fn source(&self) -> RuntimeEventSource
pub fn source(&self) -> RuntimeEventSource
Returns the object that emitted this event.
Sourcepub fn code(&self) -> i32
pub fn code(&self) -> i32
Returns the secondary detail whose meaning the event type selects. See
RuntimeEvent::code.
Sourcepub fn payload(&self) -> RuntimeEventPayload
pub fn payload(&self) -> RuntimeEventPayload
Decodes the payload union member that this event’s payload type names. A payload type this version does not define keeps its raw value and the payload’s copied byte window.
Sourcepub fn message(&self) -> Result<Option<&'a str>>
pub fn message(&self) -> Result<Option<&'a str>>
Returns this event’s message as text, or None when it carries no
message. A message that is not UTF-8 fails on its own event.
Sourcepub fn message_bytes(&self) -> &'a [u8] ⓘ
pub fn message_bytes(&self) -> &'a [u8] ⓘ
Returns this event’s message bytes, which are empty when it carries no message.
Sourcepub fn to_owned(&self) -> Result<RuntimeEvent>
pub fn to_owned(&self) -> Result<RuntimeEvent>
Copies this event into a value that outlives the batch.
Trait Implementations§
Source§impl<'a> Clone for RuntimeEventRef<'a>
impl<'a> Clone for RuntimeEventRef<'a>
Source§fn clone(&self) -> RuntimeEventRef<'a>
fn clone(&self) -> RuntimeEventRef<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RuntimeEventRef<'_>
impl Debug for RuntimeEventRef<'_>
impl<'a> Copy for RuntimeEventRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for RuntimeEventRef<'a>
impl<'a> RefUnwindSafe for RuntimeEventRef<'a>
impl<'a> Send for RuntimeEventRef<'a>
impl<'a> Sync for RuntimeEventRef<'a>
impl<'a> Unpin for RuntimeEventRef<'a>
impl<'a> UnsafeUnpin for RuntimeEventRef<'a>
impl<'a> UnwindSafe for RuntimeEventRef<'a>
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