Struct vga::writers::Text80x25[][src]

pub struct Text80x25;
Expand description

A basic interface for interacting with vga text mode 80x25

Examples

Basic usage:

use vga::colors::{Color16, TextModeColor};
use vga::writers::{ScreenCharacter, TextWriter, Text80x25};

let text_mode = Text80x25::new();
let color = TextModeColor::new(Color16::Yellow, Color16::Black);
let screen_character = ScreenCharacter::new(b'T', color);

text_mode.set_mode();
text_mode.clear_screen();
text_mode.write_character(0, 0, screen_character);

Implementations

impl Text80x25[src]

pub const fn new() -> Text80x25[src]

Creates a new Text80x25.

Trait Implementations

impl Clone for Text80x25[src]

fn clone(&self) -> Text80x25[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Text80x25[src]

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

Formats the value using the given formatter. Read more

impl Default for Text80x25[src]

fn default() -> Text80x25[src]

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

impl Screen for Text80x25[src]

const WIDTH: usize[src]

The width of the Screen.

const HEIGHT: usize[src]

The height of the Screen.

const SIZE: usize[src]

The size (total area) of the Screen.

impl TextWriter for Text80x25[src]

fn set_mode(&self)[src]

Sets the graphics device to a video mode as determined by the TextWriter implementation. Read more

fn get_frame_buffer(&self) -> (SpinlockGuard<'_, Vga>, *mut ScreenCharacter)[src]

Returns the start of the FrameBuffer as *mut ScreenCharacter as well as a lock to the vga driver. This ensures the vga driver stays locked while the frame buffer is in use. Read more

fn clear_screen(&self)[src]

Clears the screen by setting all cells to b' ' with a background color of Color16::Black and a foreground color of Color16::Yellow. Read more

fn fill_screen(&self, character: ScreenCharacter)[src]

Fills the screen by setting all cells to the given screen character.

fn disable_cursor(&self)[src]

Disables the cursor in vga text modes.

fn enable_cursor(&self)[src]

Enables the cursor in vga text modes.

fn read_character(&self, x: usize, y: usize) -> ScreenCharacter[src]

Returns the ScreenCharacter at the given (x, y) position.

fn set_cursor(&self, scan_line_start: u8, scan_line_end: u8)[src]

Sets the size of the cursor, as specified by scan_line_start and scan_line_end. Read more

fn set_cursor_position(&self, x: usize, y: usize)[src]

Sets the current text cursor to the position specified by x and y. Read more

fn write_character(&self, x: usize, y: usize, screen_character: ScreenCharacter)[src]

Prints the given character and color at (x, y).

impl Copy for Text80x25[src]

Auto Trait Implementations

impl Send for Text80x25

impl Sync for Text80x25

impl Unpin for Text80x25

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.