pub struct FormatterContext<'a> { /* private fields */ }
Expand description
Provides context for formatters.
Implementations§
Source§impl FormatterContext<'_>
impl FormatterContext<'_>
Sourcepub fn set_style_range(&mut self, range: Option<Range<usize>>)
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.
Sourcepub fn style_range(&self) -> Option<Range<usize>>
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>
impl<'a> Debug for FormatterContext<'a>
Source§impl<'a> Default for FormatterContext<'a>
impl<'a> Default for FormatterContext<'a>
Source§fn default() -> FormatterContext<'a>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more