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) -> Self
pub const fn new(prefix: &'a str, suffix: &'a str) -> Self
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() -> Self
pub const fn empty() -> Self
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<'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> PartialEq for ANSIStr<'a>
impl<'a> PartialEq for ANSIStr<'a>
source§impl<'a> PartialOrd for ANSIStr<'a>
impl<'a> PartialOrd for ANSIStr<'a>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<'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
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)