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: boolImplementations§
Source§impl Screen
impl Screen
pub fn new(rows: usize, columns: usize) -> Self
pub fn size(&self) -> usize
Sourcepub fn position(&self, address: usize) -> (usize, usize)
pub fn position(&self, address: usize) -> (usize, usize)
Row and column (both from 1) of a buffer address.
pub fn address(&self, row: usize, column: usize) -> usize
Sourcepub fn fields(&self) -> Vec<FieldView>
pub fn fields(&self) -> Vec<FieldView>
Every field, in buffer order; empty when the screen is unformatted.
Sourcepub fn field_at(&self, address: usize) -> Option<FieldView>
pub fn field_at(&self, address: usize) -> Option<FieldView>
The field a buffer address falls in.
pub fn field_data(&self, field: &FieldView) -> Vec<u8> ⓘ
Sourcepub fn home(&mut self)
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.
Sourcepub fn tab(&mut self)
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.
Sourcepub fn apply(&mut self, stream: &[u8]) -> Result<(), String>
pub fn apply(&mut self, stream: &[u8]) -> Result<(), String>
Applies an outbound data stream: a command, its WCC, then orders and data.
Sourcepub fn type_at(&mut self, address: usize, text: &[u8]) -> Result<(), String>
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.
Sourcepub fn erase_eof(&mut self, address: usize) -> Result<(), String>
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.