#[repr(transparent)]pub struct Attribute(u8);
Expand description
Defines the style a cga character including its background and foreground colors.
Tuple Fields§
§0: u8
Implementations§
source§impl Attribute
impl Attribute
const FG_BITS: usize = 4usize
const FG_OFFSET: usize = 0usize
const BG_BITS: usize = 3usize
const BG_OFFSET: usize = 4usize
const BLINK_BITS: usize = 1usize
const BLINK_OFFSET: usize = 7usize
sourceconst fn with_fg_checked(self, value: Color) -> Result<Self, ()>
const fn with_fg_checked(self, value: Color) -> Result<Self, ()>
Foreground color of the character
Bits: 0..4
sourcefn set_fg_checked(&mut self, value: Color) -> Result<(), ()>
fn set_fg_checked(&mut self, value: Color) -> Result<(), ()>
Foreground color of the character
Bits: 0..4
sourceconst fn with_bg_checked(self, value: Color) -> Result<Self, ()>
const fn with_bg_checked(self, value: Color) -> Result<Self, ()>
Background color
Bits: 4..7
sourcefn set_bg_checked(&mut self, value: Color) -> Result<(), ()>
fn set_bg_checked(&mut self, value: Color) -> Result<(), ()>
Background color
Bits: 4..7
sourceconst fn blink(&self) -> bool
const fn blink(&self) -> bool
If the character should blink (might not work in some cases)
Bits: 7..8
sourceconst fn with_blink_checked(self, value: bool) -> Result<Self, ()>
const fn with_blink_checked(self, value: bool) -> Result<Self, ()>
If the character should blink (might not work in some cases)
Bits: 7..8
sourceconst fn with_blink(self, value: bool) -> Self
const fn with_blink(self, value: bool) -> Self
If the character should blink (might not work in some cases)
Bits: 7..8
sourcefn set_blink(&mut self, value: bool)
fn set_blink(&mut self, value: bool)
If the character should blink (might not work in some cases)
Bits: 7..8
sourcefn set_blink_checked(&mut self, value: bool) -> Result<(), ()>
fn set_blink_checked(&mut self, value: bool) -> Result<(), ()>
If the character should blink (might not work in some cases)
Bits: 7..8
Trait Implementations§
impl Copy for Attribute
Auto Trait Implementations§
impl Freeze for Attribute
impl RefUnwindSafe for Attribute
impl Send for Attribute
impl Sync for Attribute
impl Unpin for Attribute
impl UnwindSafe for Attribute
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§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> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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
)§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
§impl<T, U> TryFrom<U> for Twhere
U: Into<T>,
impl<T, U> TryFrom<U> for Twhere
U: Into<T>,
§impl<T, U> TryInto<U> for Twhere
U: TryFrom<T>,
impl<T, U> TryInto<U> for Twhere
U: TryFrom<T>,
source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.