Skip to main content

LogMessage

Struct LogMessage 

Source
#[repr(C)]
pub struct LogMessage<'a> { pub severity: u8, pub tags: CppArray<'a, CppString<'a>>, pub pid: u64, pub tid: u64, pub dropped: u64, pub message: CppString<'a>, pub file: CppString<'a>, pub line: u64, pub moniker_tag: CppString<'a>, pub kvps: CppArray<'a, CppKeyValue<'a>>, pub timestamp: i64, }
Expand description

Log message representation for FFI with C++.

§Lifetime and Borrowing

Strings within LogMessage (tags, message, and string keys/values in kvps) borrow directly from the incoming encoded message buffer (bytes) when possible, or from the provided arena allocator (Bump). Consequently, the incoming message buffer MUST remain valid and unmodified for at least as long as the LogMessage is in use.

Fields§

§severity: u8

Severity of a log message.

§tags: CppArray<'a, CppString<'a>>

Tags in a log message, guaranteed to be non-null.

§pid: u64

Process ID from a LogMessage, or 0 if unknown

§tid: u64

Thread ID from a LogMessage, or 0 if unknown

§dropped: u64

Number of dropped log messages.

§message: CppString<'a>

The UTF-encoded log message, guaranteed to be valid UTF-8.

§file: CppString<'a>

Source file where the log was emitted, if any.

§line: u64

Source line where the log was emitted, if any.

§moniker_tag: CppString<'a>

Last segment of the moniker, used as a default log tag if needed.

§kvps: CppArray<'a, CppKeyValue<'a>>

Key-value pairs in a log message.

§timestamp: i64

Timestamp on the boot timeline of the log message, in nanoseconds.

Auto Trait Implementations§

§

impl<'a> Freeze for LogMessage<'a>

§

impl<'a> RefUnwindSafe for LogMessage<'a>

§

impl<'a> !Send for LogMessage<'a>

§

impl<'a> !Sync for LogMessage<'a>

§

impl<'a> Unpin for LogMessage<'a>

§

impl<'a> UnsafeUnpin for LogMessage<'a>

§

impl<'a> UnwindSafe for LogMessage<'a>

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
§

impl<T, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
§

impl<T, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
§

impl<F, N> FidlIntoNative<Box<N>> for F
where F: FidlIntoNative<N>,

§

fn fidl_into_native(self) -> Box<N>

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.