Skip to main content

CapturedSink

Struct CapturedSink 

Source
pub struct CapturedSink { /* private fields */ }
Expand description

Buffering sink that accumulates formatted entries for an interactive consumer to drain. The TUI installs one for the alt-screen lifetime so lsm_warn! / lsm_error! / lsm_debug! surface in the live-preview warnings panel instead of painting over the rendered frame.

Captured format is [<tag>] <msg> — the surrounding UI prefixes each line with its own marker (e.g. ), so the linesmith prefix and colon would be redundant noise.

Implementations§

Source§

impl CapturedSink

Source

pub fn drain(&self) -> Vec<String>

Take all currently-buffered entries, leaving the sink empty. The TUI calls this between draws so each frame’s warnings reflect that frame’s render only.

Trait Implementations§

Source§

impl Debug for CapturedSink

Source§

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

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

impl Default for CapturedSink

Source§

fn default() -> CapturedSink

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

impl LogSink for CapturedSink

Source§

fn emit(&self, lvl: Level, msg: &str)

Emit a level-gated diagnostic. The caller has already confirmed the level is enabled — the sink writes unconditionally. Implementations defensively no-op on Level::Off rather than relying on the caller; the macros never pass Off, but emit() is pub.
Source§

fn emit_error(&self, msg: &str)

Emit a structural-failure diagnostic. Always fires regardless of the configured level — LINESMITH_LOG=off users still see “the statusline broke” because there’s no other channel.

Auto Trait Implementations§

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

Source§

type Output = T

Should always be Self
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.