Struct FormatterContext

Source
pub struct FormatterContext<'a> { /* private fields */ }
Expand description

Provides context for formatters.

Implementations§

Source§

impl FormatterContext<'_>

Source

pub fn new() -> Self

Constructs a FormatterContext.

Source

pub fn set_style_range(&mut self, range: Option<Range<usize>>)

Sets style range (in bytes) of the formatted text.

Users must ensure that indexes are correctly UTF-8 boundary.

Source

pub fn style_range(&self) -> Option<Range<usize>>

A style range (in bytes) of the formatted text.

If style is available in the sink, the text in the range will be rendered in the style corresponding to that log message level, otherwise it will be ignored.

Its indexes are guaranteed by the setter to be the correct UTF-8 boundary.

Trait Implementations§

Source§

impl<'a> Debug for FormatterContext<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Default for FormatterContext<'a>

Source§

fn default() -> FormatterContext<'a>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for FormatterContext<'a>

§

impl<'a> RefUnwindSafe for FormatterContext<'a>

§

impl<'a> Send for FormatterContext<'a>

§

impl<'a> Sync for FormatterContext<'a>

§

impl<'a> Unpin for FormatterContext<'a>

§

impl<'a> UnwindSafe for FormatterContext<'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
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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

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.