pub struct TLine {
pub strings: Vec<TString>,
}Expand description
a simple representation of a line made of homogeneous parts.
Note that this only manages CSI and SGR components and isn’t a suitable representation for an arbitrary terminal input or output. I recommend you to NOT try to reuse this hack in another project unless you perfectly understand it.
Fields§
§strings: Vec<TString>Implementations§
Source§impl TLine
impl TLine
pub fn change_range_style(&mut self, trange: TRange, new_csi: String)
pub fn from_tty(tty: &str) -> Self
pub fn from_raw(raw: String) -> Self
pub fn to_raw(&self) -> String
pub fn bold(raw: String) -> Self
pub fn italic(raw: String) -> Self
pub fn failed(key: &str) -> Self
pub fn passed(key: &str) -> Self
pub fn add_badge(&mut self, badge: TString)
pub fn add_tstring<C: Into<String>, R: Into<String>>(&mut self, csi: C, raw: R)
pub fn draw(&self, w: &mut W) -> Result<()>
Sourcepub fn draw_in(&self, w: &mut W, cols_max: usize) -> Result<usize>
pub fn draw_in(&self, w: &mut W, cols_max: usize) -> Result<usize>
draw the line but without taking more than cols_max cols.
Return the number of cols written
pub fn is_blank(&self) -> bool
pub fn if_unstyled(&self) -> Option<&str>
pub fn has(&self, part: &str) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TLine
impl<'de> Deserialize<'de> for TLine
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TLine
impl StructuralPartialEq for TLine
Auto Trait Implementations§
impl Freeze for TLine
impl RefUnwindSafe for TLine
impl Send for TLine
impl Sync for TLine
impl Unpin for TLine
impl UnwindSafe for TLine
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IQ for Twhere
T: Serialize,
impl<T> IQ for Twhere
T: Serialize,
Source§fn extract_primitive<P>(&self, path: P) -> Option<String>where
P: IqPath,
fn extract_primitive<P>(&self, path: P) -> Option<String>where
P: IqPath,
Extract a “primitive” value (including strings, simple enum variants, etc)
as a string using the Display implementation of the deep value.
Source§fn extract_json_pretty<P>(&self, path: P) -> Option<String>where
P: IqPath,
fn extract_json_pretty<P>(&self, path: P) -> Option<String>where
P: IqPath,
Extract a value as JSON, pretty
Source§fn extract_value<P, V>(&self, path: P) -> Result<Option<V>, IqError>where
P: IqPath,
V: DeserializeOwned,
fn extract_value<P, V>(&self, path: P) -> Result<Option<V>, IqError>where
P: IqPath,
V: DeserializeOwned,
Extract a value in a type which must implement
Deserialize, from a value, at
the given path. Read more