Skip to main content

Screen

Struct Screen 

Source
pub struct Screen {
    pub rows: usize,
    pub columns: usize,
    pub cursor: usize,
    pub alarm: bool,
    pub keyboard_locked: bool,
    /* private fields */
}

Fields§

§rows: usize§columns: usize§cursor: usize§alarm: bool§keyboard_locked: bool

Implementations§

Source§

impl Screen

Source

pub fn new(rows: usize, columns: usize) -> Self

Source

pub fn size(&self) -> usize

Source

pub fn position(&self, address: usize) -> (usize, usize)

Row and column (both from 1) of a buffer address.

Source

pub fn address(&self, row: usize, column: usize) -> usize

Source

pub fn fields(&self) -> Vec<FieldView>

Every field, in buffer order; empty when the screen is unformatted.

Source

pub fn field_at(&self, address: usize) -> Option<FieldView>

The field a buffer address falls in.

Source

pub fn field_data(&self, field: &FieldView) -> Vec<u8> ⓘ

Source

pub fn home(&mut self)

The Home key: the cursor to the first position of the first unprotected field, or to address 0 when the screen has none.

Source

pub fn tab(&mut self)

The Tab key: the cursor to the first position of the next unprotected field after it, wrapping, or to address 0 when the screen has none.

Source

pub fn apply(&mut self, stream: &[u8]) -> Result<(), String>

Applies an outbound data stream: a command, its WCC, then orders and data.

Source

pub fn type_at(&mut self, address: usize, text: &[u8]) -> Result<(), String>

The operator typing text (EBCDIC) at an address: it must be in an unprotected field, and it sets the field’s modified bit. Typing stops at the end of the field. An unformatted screen takes typing anywhere, wrapping at its end.

Source

pub fn erase_eof(&mut self, address: usize) -> Result<(), String>

ERASE EOF: clears the rest of the field at an address and sets its modified bit.

Source

pub fn read_modified(&self, aid: u8) -> Vec<u8> ⓘ

The inbound stream an AID key sends: Read Modified, or the short read of CLEAR and the PA keys (the AID alone). Nulls in a field’s data are not sent.

Source

pub fn render(&self, page: &CodePage) -> String

The screen as text: attribute positions and nulls as spaces, non-display fields blank.

Trait Implementations§

Source§

impl Clone for Screen

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Screen

Source§

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

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

impl Eq for Screen

Source§

impl PartialEq for Screen

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Screen

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.