rstubs::device::vga

Struct ModeAttributes

source
#[repr(transparent)]
struct ModeAttributes(u16);

Tuple Fields§

§0: u16

Implementations§

source§

impl ModeAttributes

source

const TEXT_MODE_BITS: usize = 1usize

source

const TEXT_MODE_OFFSET: usize = 0usize

source

const SUPPORTED_BITS: usize = 1usize

source

const SUPPORTED_OFFSET: usize = 1usize

source

const TTY_BITS: usize = 1usize

source

const TTY_OFFSET: usize = 2usize

source

const COLOR_BITS: usize = 1usize

source

const COLOR_OFFSET: usize = 3usize

source

const GRAPHICS_BITS: usize = 1usize

source

const GRAPHICS_OFFSET: usize = 4usize

source

const VGA_BITS: usize = 1usize

source

const VGA_OFFSET: usize = 5usize

source

const VGA_PAGED_BITS: usize = 1usize

source

const VGA_PAGED_OFFSET: usize = 6usize

source

const LFB_BITS: usize = 1usize

source

const LFB_OFFSET: usize = 7usize

source

const fn new() -> Self

Creates a new default initialized bitfield.

source

const fn from_bits(bits: u16) -> Self

Convert from bits.

source

const fn into_bits(self) -> u16

Convert into bits.

source

const fn text_mode(&self) -> bool

Text mode

Bits: 0..1

source

const fn with_text_mode_checked(self, value: bool) -> Result<Self, ()>

Text mode

Bits: 0..1

source

const fn with_text_mode(self, value: bool) -> Self

Text mode

Bits: 0..1

source

fn set_text_mode(&mut self, value: bool)

Text mode

Bits: 0..1

source

fn set_text_mode_checked(&mut self, value: bool) -> Result<(), ()>

Text mode

Bits: 0..1

source

const fn supported(&self) -> bool

Mode supported by hardware configuration

Bits: 1..2

source

const fn with_supported_checked(self, value: bool) -> Result<Self, ()>

Mode supported by hardware configuration

Bits: 1..2

source

const fn with_supported(self, value: bool) -> Self

Mode supported by hardware configuration

Bits: 1..2

source

fn set_supported(&mut self, value: bool)

Mode supported by hardware configuration

Bits: 1..2

source

fn set_supported_checked(&mut self, value: bool) -> Result<(), ()>

Mode supported by hardware configuration

Bits: 1..2

source

const fn tty(&self) -> bool

TTY Output functions supported by BIOS

Bits: 2..3

source

const fn with_tty_checked(self, value: bool) -> Result<Self, ()>

TTY Output functions supported by BIOS

Bits: 2..3

source

const fn with_tty(self, value: bool) -> Self

TTY Output functions supported by BIOS

Bits: 2..3

source

fn set_tty(&mut self, value: bool)

TTY Output functions supported by BIOS

Bits: 2..3

source

fn set_tty_checked(&mut self, value: bool) -> Result<(), ()>

TTY Output functions supported by BIOS

Bits: 2..3

source

const fn color(&self) -> bool

Color mode (otherwise monochrome)

Bits: 3..4

source

const fn with_color_checked(self, value: bool) -> Result<Self, ()>

Color mode (otherwise monochrome)

Bits: 3..4

source

const fn with_color(self, value: bool) -> Self

Color mode (otherwise monochrome)

Bits: 3..4

source

fn set_color(&mut self, value: bool)

Color mode (otherwise monochrome)

Bits: 3..4

source

fn set_color_checked(&mut self, value: bool) -> Result<(), ()>

Color mode (otherwise monochrome)

Bits: 3..4

source

const fn graphics(&self) -> bool

Graphic mode (otherwise text)

Bits: 4..5

source

const fn with_graphics_checked(self, value: bool) -> Result<Self, ()>

Graphic mode (otherwise text)

Bits: 4..5

source

const fn with_graphics(self, value: bool) -> Self

Graphic mode (otherwise text)

Bits: 4..5

source

fn set_graphics(&mut self, value: bool)

Graphic mode (otherwise text)

Bits: 4..5

source

fn set_graphics_checked(&mut self, value: bool) -> Result<(), ()>

Graphic mode (otherwise text)

Bits: 4..5

source

const fn vga(&self) -> bool

VGA compatible

Bits: 5..6

source

const fn with_vga_checked(self, value: bool) -> Result<Self, ()>

VGA compatible

Bits: 5..6

source

const fn with_vga(self, value: bool) -> Self

VGA compatible

Bits: 5..6

source

fn set_vga(&mut self, value: bool)

VGA compatible

Bits: 5..6

source

fn set_vga_checked(&mut self, value: bool) -> Result<(), ()>

VGA compatible

Bits: 5..6

source

const fn vga_paged(&self) -> bool

VGA compatible windowed memory mode is available

Bits: 6..7

source

const fn with_vga_paged_checked(self, value: bool) -> Result<Self, ()>

VGA compatible windowed memory mode is available

Bits: 6..7

source

const fn with_vga_paged(self, value: bool) -> Self

VGA compatible windowed memory mode is available

Bits: 6..7

source

fn set_vga_paged(&mut self, value: bool)

VGA compatible windowed memory mode is available

Bits: 6..7

source

fn set_vga_paged_checked(&mut self, value: bool) -> Result<(), ()>

VGA compatible windowed memory mode is available

Bits: 6..7

source

const fn lfb(&self) -> bool

Linear frame buffer mode is available

Bits: 7..8

source

const fn with_lfb_checked(self, value: bool) -> Result<Self, ()>

Linear frame buffer mode is available

Bits: 7..8

source

const fn with_lfb(self, value: bool) -> Self

Linear frame buffer mode is available

Bits: 7..8

source

fn set_lfb(&mut self, value: bool)

Linear frame buffer mode is available

Bits: 7..8

source

fn set_lfb_checked(&mut self, value: bool) -> Result<(), ()>

Linear frame buffer mode is available

Bits: 7..8

Trait Implementations§

source§

impl Clone for ModeAttributes

source§

fn clone(&self) -> ModeAttributes

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ModeAttributes

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for ModeAttributes

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl From<ModeAttributes> for u16

source§

fn from(v: ModeAttributes) -> u16

Converts to this type from the input type.
source§

impl From<u16> for ModeAttributes

source§

fn from(v: u16) -> Self

Converts to this type from the input type.
source§

impl Copy for ModeAttributes

Auto Trait Implementations§

§

impl Freeze for ModeAttributes

§

impl RefUnwindSafe for ModeAttributes

§

impl Send for ModeAttributes

§

impl Sync for ModeAttributes

§

impl Unpin for ModeAttributes

§

impl UnwindSafe for ModeAttributes

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Az for T

source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

source§

fn cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> CheckedAs for T

source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

source§

impl<T> OverflowingAs for T

source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
source§

impl<T> SaturatingAs for T

source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> UnwrappedAs for T

source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> WrappingAs for T

source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.