pub trait Backend {
type Error: Debug + Display;
type Clock: BackendClock;
type Events: BackendEventSource<Error = Self::Error>;
type Presenter: BackendPresenter<Error = Self::Error>;
// Required methods
fn clock(&self) -> &Self::Clock;
fn events(&mut self) -> &mut Self::Events;
fn presenter(&mut self) -> &mut Self::Presenter;
}Expand description
Unified backend combining clock, event source, and presenter.
The Program runtime is generic over this trait. Concrete implementations:
ftui-tty: native Unix/macOS terminal (and eventually Windows).ftui-web: WASM + DOM + WebGPU renderer.
Required Associated Types§
Sourcetype Clock: BackendClock
type Clock: BackendClock
Clock implementation.
Sourcetype Events: BackendEventSource<Error = Self::Error>
type Events: BackendEventSource<Error = Self::Error>
Event source implementation.
Sourcetype Presenter: BackendPresenter<Error = Self::Error>
type Presenter: BackendPresenter<Error = Self::Error>
Presenter implementation.