pub trait App {
// Required method
fn frame(&mut self, ui: &mut Ui);
// Provided methods
fn actions(&self) -> &'static [ActionSpec] { ... }
fn action_revision(&self) -> Option<u64> { ... }
fn action_available(&self, _spec: &ActionSpec) -> Result<(), ActionError> { ... }
fn action(
&mut self,
_ui: &mut Ui,
_spec: &ActionSpec,
_input: &Value,
_context: &ActionContext,
) -> Result<ActionResult, ActionError> { ... }
fn action_inspect(&self, _query: &Value) -> Result<Value, ActionError> { ... }
fn action_resource_info(&self, _uri: &str) -> Result<Resource, ActionError> { ... }
fn action_resource_read(
&self,
_uri: &str,
_offset: u64,
_limit: usize,
) -> Result<Vec<u8>, ActionError> { ... }
fn init(&mut self, _ui: &mut Ui) -> bool { ... }
fn command(&mut self, _ui: &mut Ui, _id: u32, _arg: u32) -> bool { ... }
}Expand description
the app’s callbacks (APP_DESC on_init, on_frame, on_command)
Required Methods§
Provided Methods§
Sourcefn actions(&self) -> &'static [ActionSpec]
fn actions(&self) -> &'static [ActionSpec]
Optional domain actions, in addition to the universal UI action catalogue.
Sourcefn action_revision(&self) -> Option<u64>
fn action_revision(&self) -> Option<u64>
Domain revision. None uses the UI runtime’s own: it moves with the controls (their set, labels, values and states, the focus, an open modal dialog, the title, enabled commands) and with every agent call that changes something, not with frames or the pointer, and it knows nothing of a change the user makes to the app’s data.
Sourcefn action_available(&self, _spec: &ActionSpec) -> Result<(), ActionError>
fn action_available(&self, _spec: &ActionSpec) -> Result<(), ActionError>
Dynamic domain constraints such as read-only files or an absent selection.
Sourcefn action(
&mut self,
_ui: &mut Ui,
_spec: &ActionSpec,
_input: &Value,
_context: &ActionContext,
) -> Result<ActionResult, ActionError>
fn action( &mut self, _ui: &mut Ui, _spec: &ActionSpec, _input: &Value, _context: &ActionContext, ) -> Result<ActionResult, ActionError>
Domain action handler; adapters should call the same editing functions as the GUI.
Sourcefn action_inspect(&self, _query: &Value) -> Result<Value, ActionError>
fn action_inspect(&self, _query: &Value) -> Result<Value, ActionError>
Filtered domain state; the default universal inspection includes the widget tree.
Sourcefn action_resource_info(&self, _uri: &str) -> Result<Resource, ActionError>
fn action_resource_info(&self, _uri: &str) -> Result<Resource, ActionError>
Describe an application-owned binary resource returned by one of its actions.
Sourcefn action_resource_read(
&self,
_uri: &str,
_offset: u64,
_limit: usize,
) -> Result<Vec<u8>, ActionError>
fn action_resource_read( &self, _uri: &str, _offset: u64, _limit: usize, ) -> Result<Vec<u8>, ActionError>
Read a bounded byte range of an application-owned resource, never an arbitrary path.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".