Struct termimad::CropWriter [−][src]
pub struct CropWriter<'w, W> where
W: Write, {
pub w: &'w mut W,
pub allowed: usize,
pub tab_replacement: &'static str,
}
Expand description
wrap a writer to ensure that at most allowed
columns are
written.
Fields
w: &'w mut W
allowed: usize
number of screen columns which may be covered
tab_replacement: &'static str
the string replacing a tabulation
Implementations
return a tuple containing a string containing either the given &str or the part fitting the remaining width, and the width of this string)
a “g_string” is a “gentle” one: each char takes one column on screen. This function must thus not be used for unknown strings.
a “g_string” is a “gentle” one: each char takes one column on screen. This function must thus not be used for unknown strings.