pub struct ProxyApp {Show 17 fields
pub name: String,
pub shared_buffer: Arc<Mutex<Vec<u32>>>,
pub event_queue: Arc<Mutex<Vec<AppEvent>>>,
pub is_alive: Arc<AtomicBool>,
pub active_tab: Arc<Mutex<usize>>,
pub tabs: Arc<Mutex<Vec<String>>>,
pub live_title: Arc<Mutex<Option<String>>>,
pub needs_timer_redraw: Arc<AtomicBool>,
pub buffer_updated: Arc<AtomicBool>,
pub heartbeat_ms: Arc<AtomicU64>,
pub tab_kill: Arc<AtomicUsize>,
pub running_tab: Arc<AtomicUsize>,
pending: PendingEvents<AppEvent>,
deferred_active: Option<usize>,
cached_title: Option<String>,
cached_tabs: Vec<String>,
cached_active: usize,
}Fields§
§name: String§event_queue: Arc<Mutex<Vec<AppEvent>>>§is_alive: Arc<AtomicBool>§active_tab: Arc<Mutex<usize>>§tabs: Arc<Mutex<Vec<String>>>§live_title: Arc<Mutex<Option<String>>>App::live_title の写し(app_runner_entry が更新する)。
needs_timer_redraw: Arc<AtomicBool>§buffer_updated: Arc<AtomicBool>app_runner_entry 側が shared_buffer を更新したらセットされるフラグ。 Core 0 の dirty 判定がこれを読んでウィンドウ矩形を dirty 登録し、クリアする。
heartbeat_ms: Arc<AtomicU64>アプリのスレッドが 1 周(イベントの処理+描画)を始めた最後の時刻(ms。0 はまだ)。
OS 側はこれで「返ってこないアプリ」を見分け、止める入口を出す(TODO R2 (a)。App::unresponsive_ms)。
tab_kill: Arc<AtomicUsize>「このタブだけ止める」の合図(タブの番号+1。0 は無し。TODO R2 (d)、2026-11-18)。OS 側が書き、アプリのスレッドが読んで倒す。
running_tab: Arc<AtomicUsize>アプリのスレッドが今動かしているタブの番号(アプリのスレッドが書く。TODO R2 (d))。
pending: PendingEvents<AppEvent>錠(event_queue)が取れずにまだ渡せていない入力。OS 側だけが持つ(TODO R4 (b)、2026-11-17)。
次の周の App::os_tick か、次の入力のときに来た順のまま渡す。
deferred_active: Option<usize>錠が取れずにまだ書けていないタブの切り替え先(active_tab へ書く値)。
cached_title: Option<String>錠が取れないときに返す、最後に読めた写し(題名・タブ・選んでいるタブ)。
cached_tabs: Vec<String>§cached_active: usizeImplementations§
Source§impl ProxyApp
impl ProxyApp
Sourcefn flush_pending(&mut self)
fn flush_pending(&mut self)
控えた入力をアプリのキューへ渡す。錠が取れなければ控えたまま(次の周に渡す)。
Source§impl ProxyApp
impl ProxyApp
pub fn new( name: &str, shared_buffer: Arc<Mutex<Vec<u32>>>, event_queue: Arc<Mutex<Vec<AppEvent>>>, is_alive: Arc<AtomicBool>, active_tab: Arc<Mutex<usize>>, tabs: Arc<Mutex<Vec<String>>>, live_title: Arc<Mutex<Option<String>>>, needs_timer_redraw: Arc<AtomicBool>, buffer_updated: Arc<AtomicBool>, ) -> Self
Trait Implementations§
Source§impl App for ProxyApp
impl App for ProxyApp
fn name(&self) -> &str
共有されるバックバッファを返す
Source§fn draw(
&mut self,
_screen: &Screen,
_win_x: u32,
_win_y: u32,
_win_w: u32,
_win_h: u32,
)
fn draw( &mut self, _screen: &Screen, _win_x: u32, _win_y: u32, _win_w: u32, _win_h: u32, )
ウィンドウ内の描画要求
Source§fn on_mouse(
&mut self,
local_x: i32,
local_y: i32,
btn_left: bool,
btn_right: bool,
wheel: i32,
)
fn on_mouse( &mut self, local_x: i32, local_y: i32, btn_left: bool, btn_right: bool, wheel: i32, )
マウスイベント。ローカル座標とホイール移動量が渡される。
Source§fn live_title(&self) -> Option<String>
fn live_title(&self) -> Option<String>
タブタイトル一覧。空を返すとタブなし扱い(非推奨: 全アプリは最低1タブ持つ)
タイトルバーに出す文字(
None なら作成時の Window.title)。ページで変わるアプリが使う。fn tabs(&self) -> Vec<String>
fn active_tab(&self) -> usize
fn switch_tab(&mut self, idx: usize)
fn add_tab(&mut self)
Source§fn open_url_in_new_tab(&mut self, url: &str)
fn open_url_in_new_tab(&mut self, url: &str)
同じアプリが URL つきで 2 度目に起動されたとき、その URL を新しいタブで開く(2026-11-18。ブラウザだけが実装する)。
fn needs_timer_redraw(&self) -> bool
Source§fn get_buffer_updated_flag(&self) -> Option<Arc<AtomicBool>>
fn get_buffer_updated_flag(&self) -> Option<Arc<AtomicBool>>
ProxyApp の shared_buffer が更新されたことを通知する AtomicBool を返す。
ProxyApp でない通常のアプリは None を返す(デフォルト実装)。
Core 0 の dirty 判定がこのフラグを読んで矩形を登録する。
Source§fn os_tick(&mut self)
fn os_tick(&mut self)
メインループが毎周 1 回呼ぶ(TODO R4 (b)、2026-11-17)。
ProxyApp はここで、錠が取れずに控えた入力・
タブの切り替えをアプリへ渡し直し、題名・タブの写しを取り直す。錠は待たない(try_lock)。Source§fn is_stopped(&self) -> bool
fn is_stopped(&self) -> bool
アプリのスレッドがもう居ない(panic・メモリの使いすぎで止めた)か。ウィンドウは最後の画面のまま残る。
同じアプリを開き直すとき、
WindowManager::add_window はこのウィンドウを使い回さず置き換える。Source§fn unresponsive_ms(&self) -> Option<u64>
fn unresponsive_ms(&self) -> Option<u64>
アプリが応答していない時間(ms)。応答しているなら
None(TODO R2 (a))。
ProxyApp はアプリのスレッドの 1 周の始まりが UNRESPONSIVE_MS 以上前なら返す。
メインループで描くアプリは、ウォッチドッグの Not Responding(watchdog::is_not_responding)で見る(Window::unresponsive)。Source§fn kill_tab(&mut self, idx: usize) -> bool
fn kill_tab(&mut self, idx: usize) -> bool
タブを 1 つだけ止める(TODO R2 (d)、2026-11-18)。受け付けたら true。
ProxyApp は合図を立てるだけで、アプリのスレッドが、そのタブの JS を打ち切ってから 1 周の頭でタブを閉じる。Source§fn running_tab(&self) -> usize
fn running_tab(&self) -> usize
アプリのスレッドが今動かしているタブ(TODO R2 (d))。
ProxyApp では、利用者が応答しない間に
別のタブを選んでも(App::active_tab は選んだ先を返す)、アプリが実際に動かしているタブを返す。Source§fn tab_kill_pending(&self) -> Option<usize>
fn tab_kill_pending(&self) -> Option<usize>
タブを止める合図を立てたが、まだ閉じていないタブ(TODO R2 (d))。
Source§fn instance_info(&self) -> String
fn instance_info(&self) -> String
インスタンス特有の情報(ファイル名やURLなど)を返す
Source§fn memory_checkpoint(&mut self)
fn memory_checkpoint(&mut self)
アプリのスレッドの 1 周の頭(錠を持っていない所)で呼ばれる。メモリが足りないときに裏のタブを破棄する
アプリ(ブラウザ)が実装する(2026-11-19。判定は
kernel/tab_discard.rs)。Source§fn open_file_dialog(&mut self)
fn open_file_dialog(&mut self)
Alt+O: ファイルオープンダイアログを開く(未実装アプリはno-op)
Source§fn tab_thread_fn(&self) -> Option<fn()>
fn tab_thread_fn(&self) -> Option<fn()>
このアプリの各タブ用バックグラウンドスレッド関数を返す。
Some(fn) を返したアプリはタブ追加時にスケジューラでスレッドを起動する。
スレッド関数は引数なしの fn() で、グローバル Mutex 経由でアプリ状態と通信する。
fn get_dom_value(&self, _id: &str) -> Option<String>
fn set_dom_value(&mut self, _id: &str, _val: &str)
fn get_dom_content(&self, _id: &str) -> Option<String>
fn set_dom_content(&mut self, _id: &str, _val: &str)
Auto Trait Implementations§
impl !RefUnwindSafe for ProxyApp
impl !UnwindSafe for ProxyApp
impl Freeze for ProxyApp
impl Send for ProxyApp
impl Sync for ProxyApp
impl Unpin for ProxyApp
impl UnsafeUnpin for ProxyApp
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more