#[non_exhaustive]pub struct IndexdFragment {
pub sym_index: u8,
pub fg: ANSIColor,
}Expand description
Represent the fragment by the sympol index in the sympols set.
it can be useful by reduce the size that required to store a crate::Fragment by 3 bytes less.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.sym_index: u8The sympol index in the provided sympols set.
fg: ANSIColorThe symplol foregruond color.
Implementations§
Source§impl IndexdFragment
impl IndexdFragment
Sourcepub fn with_foreground(self, fg: impl Into<ANSIColor>) -> Self
pub fn with_foreground(self, fg: impl Into<ANSIColor>) -> Self
Set the foreground color.
Sourcepub const fn new_with_foreground(sym_index: u8, fg: ANSIColor) -> Self
pub const fn new_with_foreground(sym_index: u8, fg: ANSIColor) -> Self
Construct a new instance with foreground color.
Trait Implementations§
Source§impl Clone for IndexdFragment
impl Clone for IndexdFragment
Source§fn clone(&self) -> IndexdFragment
fn clone(&self) -> IndexdFragment
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 Debug for IndexdFragment
impl Debug for IndexdFragment
Source§impl From<FragmentInfo> for IndexdFragment
impl From<FragmentInfo> for IndexdFragment
Source§fn from(v: FragmentInfo) -> Self
fn from(v: FragmentInfo) -> Self
Converts to this type from the input type.
Source§impl Hash for IndexdFragment
impl Hash for IndexdFragment
Source§impl PartialEq for IndexdFragment
impl PartialEq for IndexdFragment
Source§impl PartialOrd for IndexdFragment
impl PartialOrd for IndexdFragment
impl StructuralPartialEq for IndexdFragment
Auto Trait Implementations§
impl Freeze for IndexdFragment
impl RefUnwindSafe for IndexdFragment
impl Send for IndexdFragment
impl Sync for IndexdFragment
impl Unpin for IndexdFragment
impl UnwindSafe for IndexdFragment
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more