Skip to main content

Terminal

Struct Terminal 

Source
pub struct Terminal {
    pub screen: Screen,
    pub encoding: Encoding,
    pub music_on_csi_m: bool,
    pub music_enabled: bool,
    pub sixel_display_mode: bool,
    pub syncterm: SyncTerm,
    pub mouse: MouseModes,
    pub bracketed_paste: bool,
    pub download_dir: Option<PathBuf>,
    pub fonts_dir: Option<PathBuf>,
    /* private fields */
}

Fields§

§screen: Screen§encoding: Encoding§music_on_csi_m: bool

Treat ESC [ M with no parameter as the start of ANSI music, as many BBS doors expect, instead of “delete one line”. ESC [ N and ESC [ | always start music.

§music_enabled: bool

Whether music is played at all (it isn’t waited for if not).

§sixel_display_mode: bool

CSI ? 80 h (DECSDM): sixel pictures go at the top left of the screen and don’t scroll it.

§syncterm: SyncTerm

SyncTERM’s file cache, pictures and pixel buffers.

§mouse: MouseModes

The mouse reporting the BBS has asked for.

§bracketed_paste: bool

CSI ? 2004 h: pasted text comes between ESC [ 200 ~ and ESC [ 201 ~, so the BBS can tell it from typing.

§download_dir: Option<PathBuf>

Where downloads go: RIP looks there for icons and scenes too.

§fonts_dir: Option<PathBuf>

The user’s fonts: SkyPix finds Amiga disk fonts there.

Implementations§

Source§

impl Terminal

Source

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

Source

pub fn start_emulation(&mut self)

Set up the screen for the encoding: a C64 or Atari system gets that machine’s colors and font.

Source

pub fn rip(&self) -> Option<&Rip>

The RIPscrip canvas, for a RIP system.

Source

pub fn rip_mut(&mut self) -> Option<&mut Rip>

Source

pub fn toggle_reveal(&mut self) -> Option<bool>

Show a teletext page’s concealed text, or hide it again (Viewdata and Mode 7); the new state, or None for other systems.

Source

pub fn igs(&self) -> Option<&Igs>

The Atari ST screen, for an IGS system.

Source

pub fn igs_mut(&mut self) -> Option<&mut Igs>

Source

pub fn skypix_mut(&mut self) -> Option<&mut Skypix>

The Amiga screen, for a SkyPix system.

Source

pub fn take_skypix_transfer(&mut self) -> Option<(Transfer, Vec<u8>)>

A file transfer SkyPix started, and the bytes after it.

Source

pub fn skypix(&self) -> Option<&Skypix>

Source

pub fn codepage(&self) -> Option<&'static CodePage>

The code page the BBS’s text is in, when it has chosen a code-page font for its screen (CP866, KOI8-R…): typing, pasting and copying go through it rather than CP437.

Source

pub fn text_codepage(&self) -> Option<&'static CodePage>

What the characters on the screen are, for copying them as text: the code page, or the C64’s or Atari’s screen codes.

Source

pub fn encode_text(&self, text: &str) -> Vec<u8> ⓘ

Text typed or pasted, as the BBS expects its bytes.

Source

pub fn paste(&self, text: &str) -> Vec<u8> ⓘ

Pasted text, as the BBS should get it: in brackets if it asked for them (with any escape taken out, so the text can’t end them early).

Source

pub fn take_replies(&mut self) -> Vec<u8> ⓘ

Bytes the terminal wants sent to the remote (e.g. CPR replies).

Source

pub fn take_events(&mut self) -> Vec<TermEvent>

Source

pub fn feed(&mut self, data: &[u8])

Source

pub fn poll(&mut self, now: Instant)

Time passing: sound reports the BBS asked for, and reading again after a wait for a sound.

Source

pub fn interrupt(&mut self)

A key was pressed: an IGS pause or color cycle stops for it.

Source

pub fn next_poll(&self) -> Option<Instant>

When Terminal::poll has something to do.

Source

pub fn take_rip_block(&mut self) -> Option<(BlockTransfer, Vec<u8>)>

A file transfer RIP started, and the bytes after it.

Source

pub fn rip_press(&mut self, x: usize, y: usize) -> Option<Vec<u8>>

A click on the RIP graphics at (x, y): what to send, if anything (see crate::rip::Rip::press).

Source

pub fn rip_answer(&mut self, answer: Option<String>)

The answer to a TermEvent::RipQuestion (None: cancelled); what it lets be sent is in the replies.

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more