pub struct DisplayRenderer { /* private fields */ }Expand description
Pairs a DisplayTemplate with the format’s regex so callers can render
any single line in one call. Owns its inputs so it’s Send-friendly.
Implementations§
Source§impl DisplayRenderer
impl DisplayRenderer
pub fn new(template: DisplayTemplate, regex: Regex) -> Self
pub fn template(&self) -> &DisplayTemplate
Sourcepub fn render_line(&self, line: &[u8]) -> Option<String>
pub fn render_line(&self, line: &[u8]) -> Option<String>
Render line (raw bytes) through the template. If the line doesn’t
parse against the format regex, returns None — the caller decides
whether to fall back to the raw line, skip it, or show an error.
Trait Implementations§
Source§impl Clone for DisplayRenderer
impl Clone for DisplayRenderer
Source§fn clone(&self) -> DisplayRenderer
fn clone(&self) -> DisplayRenderer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DisplayRenderer
impl RefUnwindSafe for DisplayRenderer
impl Send for DisplayRenderer
impl Sync for DisplayRenderer
impl Unpin for DisplayRenderer
impl UnsafeUnpin for DisplayRenderer
impl UnwindSafe for DisplayRenderer
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