Struct broot::display::CropWriter[][src]

pub struct CropWriter<'w, W> where
    W: Write
{ pub w: &'w mut W, pub allowed: usize, }

wrap a writer to ensure that at most allowed columns are written.

Fields

w: &'w mut Wallowed: usize

number of screen columns which may be covered

Implementations

impl<'w, W> CropWriter<'w, W> where
    W: Write
[src]

pub fn new(w: &'w mut W, limit: usize) -> Self[src]

pub fn is_full(&self) -> bool[src]

pub fn cropped_str<'a>(&self, s: &'a str) -> (Cow<'a, str>, usize)[src]

return a tuple containing a string containing either the given &str or the part fitting the remaining width, and the width of this string)

pub fn queue_unstyled_str(&mut self, s: &str) -> Result<()>[src]

pub fn queue_str(&mut self, cs: &CompoundStyle, s: &str) -> Result<()>[src]

pub fn queue_char(&mut self, cs: &CompoundStyle, c: char) -> Result<()>[src]

pub fn queue_unstyled_char(&mut self, c: char) -> Result<()>[src]

pub fn queue_unstyled_g_string(&mut self, s: String) -> Result<()>[src]

a “g_string” is a “gentle” one: each char takes one column on screen. This function must thus not be used for unknown strings.

pub fn queue_g_string(&mut self, cs: &CompoundStyle, s: String) -> Result<()>[src]

a “g_string” is a “gentle” one: each char takes one column on screen. This function must thus not be used for unknown strings.

pub fn queue_fg(&mut self, cs: &CompoundStyle) -> Result<()>[src]

pub fn queue_bg(&mut self, cs: &CompoundStyle) -> Result<()>[src]

pub fn fill(
    &mut self,
    cs: &CompoundStyle,
    filling: &'static Filling
) -> Result<()>
[src]

pub fn fill_unstyled(&mut self, filling: &'static Filling) -> Result<()>[src]

pub fn repeat(
    &mut self,
    cs: &CompoundStyle,
    filling: &'static Filling,
    len: usize
) -> Result<()>
[src]

pub fn repeat_unstyled(
    &mut self,
    filling: &'static Filling,
    len: usize
) -> Result<()>
[src]

Auto Trait Implementations

impl<'w, W> RefUnwindSafe for CropWriter<'w, W> where
    W: RefUnwindSafe

impl<'w, W> Send for CropWriter<'w, W> where
    W: Send

impl<'w, W> Sync for CropWriter<'w, W> where
    W: Sync

impl<'w, W> Unpin for CropWriter<'w, W>

impl<'w, W> !UnwindSafe for CropWriter<'w, W>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,