Skip to main content

ContextRecord

Struct ContextRecord 

Source
pub struct ContextRecord<'a, P: ContextRecordPayload> {
    pub record_schema: &'static str,
    pub timestamp: u128,
    pub level: &'static str,
    pub event: &'static str,
    pub context: UnifiedContext<'a>,
    pub payload: P,
}

Fields§

§record_schema: &'static str§timestamp: u128§level: &'static str§event: &'static str§context: UnifiedContext<'a>§payload: P

Implementations§

Source§

impl<P: ContextRecordPayload> ContextRecord<'_, P>

Source

pub fn contains(&self, path: &str) -> bool

Source

pub fn write_selected<W: Write>(&self, path: &str, writer: &mut W) -> Result<()>

Source

pub fn write_summary<W: Write>( &self, profile: &SummaryProfile, writer: &mut W, ) -> Result<()>

Values always use JSON literal escaping, including text interpolation.

Trait Implementations§

Source§

impl<'a, P> Serialize for ContextRecord<'a, P>

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

Auto Trait Implementations§

§

impl<'a, P> !RefUnwindSafe for ContextRecord<'a, P>

§

impl<'a, P> !UnwindSafe for ContextRecord<'a, P>

§

impl<'a, P> Freeze for ContextRecord<'a, P>
where P: Freeze,

§

impl<'a, P> Send for ContextRecord<'a, P>
where P: Send,

§

impl<'a, P> Sync for ContextRecord<'a, P>
where P: Sync,

§

impl<'a, P> Unpin for ContextRecord<'a, P>
where P: Unpin,

§

impl<'a, P> UnsafeUnpin for ContextRecord<'a, P>
where P: UnsafeUnpin,

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
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
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.