pub struct ANSIString<T> { /* private fields */ }Expand description
A struct that owns T, also holds ANSI styles and colors
Implementations§
Source§impl<T> ANSIString<T>
impl<T> ANSIString<T>
Sourcepub fn to_string(self) -> String
pub fn to_string(self) -> String
to_string method implemented directly on struct
for performance reasons
Sourcepub fn is_foreground_colored(&self) -> bool
pub fn is_foreground_colored(&self) -> bool
Returns true if foreground (letters) of a string is colored
Sourcepub fn is_background_colored(&self) -> bool
pub fn is_background_colored(&self) -> bool
Return true if background (bounding box) of a string is colored
Sourcepub fn is_colored(&self) -> bool
pub fn is_colored(&self) -> bool
Returns true if both background and foreground of a string is colored
Trait Implementations§
Source§impl<T: Clone> Clone for ANSIString<T>
impl<T: Clone> Clone for ANSIString<T>
Source§fn clone(&self) -> ANSIString<T>
fn clone(&self) -> ANSIString<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T> Colored for &mut ANSIString<T>
impl<T> Colored for &mut ANSIString<T>
Source§impl<T> Colored for ANSIString<T>
impl<T> Colored for ANSIString<T>
Source§impl<T: Debug> Debug for ANSIString<T>
impl<T: Debug> Debug for ANSIString<T>
Source§impl<T: AsRef<str>> From<ANSIString<T>> for String
impl<T: AsRef<str>> From<ANSIString<T>> for String
Source§fn from(value: ANSIString<T>) -> Self
fn from(value: ANSIString<T>) -> Self
Converts to this type from the input type.
Source§impl<T: PartialEq> PartialEq for ANSIString<T>
impl<T: PartialEq> PartialEq for ANSIString<T>
Source§impl<T> Styled for &mut ANSIString<T>
impl<T> Styled for &mut ANSIString<T>
Source§impl<T> Styled for ANSIString<T>
impl<T> Styled for ANSIString<T>
impl<T> StructuralPartialEq for ANSIString<T>
Auto Trait Implementations§
impl<T> Freeze for ANSIString<T>where
T: Freeze,
impl<T> RefUnwindSafe for ANSIString<T>where
T: RefUnwindSafe,
impl<T> Send for ANSIString<T>where
T: Send,
impl<T> Sync for ANSIString<T>where
T: Sync,
impl<T> Unpin for ANSIString<T>where
T: Unpin,
impl<T> UnwindSafe for ANSIString<T>where
T: UnwindSafe,
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