pub struct ANSIStr<'a> { /* private fields */ }
Expand description
The structure represents a ANSI color by suffix and prefix.
Implementations§
Source§impl<'a> ANSIStr<'a>
impl<'a> ANSIStr<'a>
Sourcepub const fn new(prefix: &'a str, suffix: &'a str) -> ANSIStr<'a>
pub const fn new(prefix: &'a str, suffix: &'a str) -> ANSIStr<'a>
Constructs a new instance with suffix and prefix.
They are not checked so you should make sure you provide correct ANSI.
Otherwise you may want to use TryFrom
.
Sourcepub const fn empty() -> ANSIStr<'a>
pub const fn empty() -> ANSIStr<'a>
Constructs a new instance with suffix and prefix set to empty strings.
Sourcepub const fn get_prefix(&self) -> &'a str
pub const fn get_prefix(&self) -> &'a str
Gets a reference to a prefix.
Sourcepub const fn get_suffix(&self) -> &'a str
pub const fn get_suffix(&self) -> &'a str
Gets a reference to a suffix.
Trait Implementations§
Source§impl From<ANSIStr<'static>> for Color
impl From<ANSIStr<'static>> for Color
Source§fn from(color: StaticColor<'static>) -> Self
fn from(color: StaticColor<'static>) -> Self
Converts to this type from the input type.
Source§impl<'a> Ord for ANSIStr<'a>
impl<'a> Ord for ANSIStr<'a>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'a> PartialOrd for ANSIStr<'a>
impl<'a> PartialOrd for ANSIStr<'a>
impl<'a> Copy for ANSIStr<'a>
impl<'a> Eq for ANSIStr<'a>
impl<'a> StructuralPartialEq for ANSIStr<'a>
Auto Trait Implementations§
impl<'a> Freeze for ANSIStr<'a>
impl<'a> RefUnwindSafe for ANSIStr<'a>
impl<'a> Send for ANSIStr<'a>
impl<'a> Sync for ANSIStr<'a>
impl<'a> Unpin for ANSIStr<'a>
impl<'a> UnwindSafe for ANSIStr<'a>
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