pub unsafe trait Log {
// Required method
fn write_with_args(
&self,
buffer: &mut [MaybeUninit<u8>],
parameters: &[Argument],
) -> usize;
// Provided methods
fn debug(&self, buffer: &mut [MaybeUninit<u8>]) -> usize { ... }
fn debug_with_args(
&self,
buffer: &mut [MaybeUninit<u8>],
args: &[Argument],
) -> usize { ... }
fn write(&self, buffer: &mut [MaybeUninit<u8>]) -> usize { ... }
}Expand description
Trait to specify the log behavior for a type.
§Safety
The implementation must ensure that the value returned by any of the methods correctly reflects the actual number of bytes written to the buffer. Returning a value greater than the number of bytes written to the buffer will result in undefined behavior, since it will lead to reading uninitialized memory from the buffer.
Required Methods§
fn write_with_args( &self, buffer: &mut [MaybeUninit<u8>], parameters: &[Argument], ) -> usize
Provided Methods§
fn debug(&self, buffer: &mut [MaybeUninit<u8>]) -> usize
fn debug_with_args( &self, buffer: &mut [MaybeUninit<u8>], args: &[Argument], ) -> usize
fn write(&self, buffer: &mut [MaybeUninit<u8>]) -> usize
Implementations on Foreign Types§
Source§impl Log for &str
Implement the log trait for the &str type.
impl Log for &str
Implement the log trait for the &str type.
fn debug_with_args( &self, buffer: &mut [MaybeUninit<u8>], _args: &[Argument], ) -> usize
fn write_with_args( &self, buffer: &mut [MaybeUninit<u8>], args: &[Argument], ) -> usize
Source§impl Log for bool
Implement the log trait for the bool type.
impl Log for bool
Implement the log trait for the bool type.