ContextData

Struct ContextData 

#[repr(C)]
pub struct ContextData { handle: *const Context, buffer: *mut c_uchar, size: i32, log_level: i32, trace_status: i32, args_num: i32, context_description: *const c_char, use_timestamp: TimestampType, user_timestamp: u32, verbose_mode: i8, }
Expand description

This structure is used for context data used in an application.

Fields§

§handle: *const Context

pointer to Context

§buffer: *mut c_uchar

buffer for building log message

§size: i32

payload size

§log_level: i32

log level

§trace_status: i32

trace status

§args_num: i32

number of arguments for extended header

§context_description: *const c_char

description of context

§use_timestamp: TimestampType

whether to use user-supplied timestamps

§user_timestamp: u32

user-supplied timestamp to use

§verbose_mode: i8

verbose mode: 1 enabled, 0 disabled

Implementations§

§

impl ContextData

pub const fn empty() -> Self

pub const unsafe fn as_buffer_slice(&self) -> &[c_uchar]

Returns a slice to the valid payload.

§Safety

This method must only be called if the context data has been initialized.

pub const fn args_num(&self) -> usize

Returns the number of arguments in the message buffer.

Auto Trait Implementations§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

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.