Skip to main content

Terminal

Struct Terminal 

Source
pub struct Terminal {
Show 13 fields logs: Vec<String>, input_buffer: String, bg_color: Color, fg_color: Color, pub(super) history: Vec<String>, pub(super) history_index: usize, pub dirty: bool, pub input_dirty: bool, pub cursor_char_idx: usize, pub env: Option<Env>, pub scroll_offset: usize, pub context: Option<Arc<AuraThreadContext>>, pub launcher_regions: Vec<(i32, i32, u32, u32, String)>,
}

Fields§

§logs: Vec<String>§input_buffer: String§bg_color: Color§fg_color: Color§history: Vec<String>§history_index: usize§dirty: bool§input_dirty: bool§cursor_char_idx: usize§env: Option<Env>§scroll_offset: usize§context: Option<Arc<AuraThreadContext>>§launcher_regions: Vec<(i32, i32, u32, u32, String)>

アプリランチャーのクリック領域 (x, y, w, h, app_name) — draw() 内で更新される

Implementations§

Source§

impl Terminal

Source

pub fn new() -> Self

Source

pub fn scroll(&mut self, lines: i32)

Source

pub fn input_char(&mut self, c: char)

Source

pub fn delete_char(&mut self)

Source

pub fn move_cursor_left(&mut self)

Source

pub fn move_cursor_right(&mut self)

Source

pub fn move_cursor_to_start(&mut self)

Source

pub fn kill_line(&mut self)

Ctrl+K (KillLine): カーソル位置から現在行の行末までを削除する(OS 共通)。

Source

pub fn move_cursor_to_end(&mut self)

Source

pub fn submit(&mut self) -> Option<String>

Source

pub fn history_up(&mut self)

Source

pub fn history_down(&mut self)

Source

pub fn print_line(&mut self, msg: String)

Source

pub fn clear_logs(&mut self)

Source

pub fn has_pending_results(&self) -> bool

非同期 Aura スレッドの実行結果(result_queue)が未処理で残っているか。 メインループはこれを見て dirty を立て、draw() に結果を吸い出させる。 (draw() 内でしか result_queue を消費しないため、結果到着時に再描画を促す必要がある)

Source

pub fn show_history(&mut self)

Source

pub fn handle_click(&self, x: i32, y: i32) -> Option<String>

クリック座標がランチャー領域に当たればアプリ名を返す

Source

pub fn draw(&mut self, screen: &Screen, wx: i32, wy: i32, ww: u32, wh: u32)

Trait Implementations§

Source§

impl Default for Terminal

Source§

fn default() -> Self

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

impl Drop for Terminal

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

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> 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> 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 = Infallible

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

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

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.