Skip to main content

Pipeline

Trait Pipeline 

Source
pub trait Pipeline: RichSink + Sized {
    // Provided methods
    fn clip(self, width: u16, marker: Option<char>) -> Clip<Self> { ... }
    fn rows(self, max: u16) -> Rows<Self> { ... }
    fn wrap(self, width: u16) -> Wrap<'static, Self> { ... }
    fn wrap_chars(self, width: u16) -> CharWrap<Self> { ... }
    fn wrap_prefixed<'p>(
        self,
        width: u16,
        first: &'p Prefix,
        cont: &'p Prefix,
    ) -> Wrap<'p, Self> { ... }
    fn tee(self, copy: &mut RichText) -> Tee<'_, Self> { ... }
    fn restyle<F: Fn(Style) -> Style>(self, map: F) -> Restyle<Self, F> { ... }
    fn prefixed<'p>(
        self,
        first: &'p Prefix,
        cont: &'p Prefix,
    ) -> Prefixed<'p, Self> { ... }
}
Expand description

Functional adapters available on every rich sink.

Provided Methods§

Source

fn clip(self, width: u16, marker: Option<char>) -> Clip<Self>

Hard-clips each row to width, optionally replacing its final cell with a marker.

Source

fn rows(self, max: u16) -> Rows<Self>

Limits output to at most max rows.

Source

fn wrap(self, width: u16) -> Wrap<'static, Self>

Word-wraps output without prefixes.

Source

fn wrap_chars(self, width: u16) -> CharWrap<Self>

Flows output grapheme-exact to width like a bare terminal: every width break is a byte-preserving RichSink::soft_wrap, so joined rows reproduce the source exactly in native copy.

Source

fn wrap_prefixed<'p>( self, width: u16, first: &'p Prefix, cont: &'p Prefix, ) -> Wrap<'p, Self>

Word-wraps output using first-row and continuation prefixes.

Source

fn tee(self, copy: &mut RichText) -> Tee<'_, Self>

Copies output into copy while forwarding it.

Source

fn restyle<F: Fn(Style) -> Style>(self, map: F) -> Restyle<Self, F>

Maps every incoming style.

Source

fn prefixed<'p>(self, first: &'p Prefix, cont: &'p Prefix) -> Prefixed<'p, Self>

Adds a prefix at the start of every row without wrapping.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<S: RichSink> Pipeline for S