Trait AppWidget
pub trait AppWidget: Widget {
Show 14 methods
// Required methods
fn app_kind(&self) -> AppKind;
fn app_title(&self) -> &str;
fn app_icon(&self) -> IconDescriptor;
// Provided methods
fn uses_host_record(&self) -> bool { ... }
fn capture_application_view(
&self,
) -> Result<Option<ApplicationLocalView>, ThawError> { ... }
fn restore_application_view(
&mut self,
_local: &ApplicationLocalView,
_doc: &AutoCommit,
) -> Result<ApplicationFocusRestore, ThawError> { ... }
fn finish_application_view_restore(&mut self) -> Result<(), ThawError> { ... }
fn permission_hint(&self) -> Option<AppKind> { ... }
fn commands(&self) -> Vec<AppCommand> { ... }
fn record_save_status(&mut self, _status: RecordSaveStatus) { ... }
fn device_shell_operation(
&mut self,
_operation: &DeviceShellOperation,
) -> Result<Value, String> { ... }
fn request_device_shell(&mut self) -> bool { ... }
fn take_save_retry(&mut self) -> bool { ... }
fn take_host_intent(&mut self) -> Option<AppHostIntent> { ... }
}Expand description
Trait every in-process app implements so the shell can host it inside a
TileContent::App. AppWidget: Widget means the shell always falls
through to the widget contract for layout, draw, and events.
Required Methods§
Provided Methods§
fn uses_host_record(&self) -> bool
fn uses_host_record(&self) -> bool
Whether this app owns a host-managed document record.
In-process apps default to one scratch record per tab. A widget that merely presents an external surface can opt out so a missing scratch record never replaces that surface with a storage-error card.
fn capture_application_view(
&self,
) -> Result<Option<ApplicationLocalView>, ThawError>
fn capture_application_view( &self, ) -> Result<Option<ApplicationLocalView>, ThawError>
Capture app-owned local presentation alongside the ordinary View.
§Errors
Rejects an invalid application contribution before either contribution is saved.
fn restore_application_view(
&mut self,
_local: &ApplicationLocalView,
_doc: &AutoCommit,
) -> Result<ApplicationFocusRestore, ThawError>
fn restore_application_view( &mut self, _local: &ApplicationLocalView, _doc: &AutoCommit, ) -> Result<ApplicationFocusRestore, ThawError>
Prepare current topology from an immutable latest-record loan.
§Errors
A payload requires explicit application support and validation.
fn finish_application_view_restore(&mut self) -> Result<(), ThawError>
fn finish_application_view_restore(&mut self) -> Result<(), ThawError>
Finish after ordinary View restoration and before any mount or capture.
§Errors
Applications may reject a prepared local plan without publishing a partial view.
fn permission_hint(&self) -> Option<AppKind>
fn permission_hint(&self) -> Option<AppKind>
Which role permission governs this app. Default None: ungated.
fn commands(&self) -> Vec<AppCommand>
fn commands(&self) -> Vec<AppCommand>
Command-palette contributions. Default is none.
fn record_save_status(&mut self, _status: RecordSaveStatus)
fn record_save_status(&mut self, _status: RecordSaveStatus)
Framework-owned durability, delivered only after the record loan ends.
fn device_shell_operation(
&mut self,
_operation: &DeviceShellOperation,
) -> Result<Value, String>
fn device_shell_operation( &mut self, _operation: &DeviceShellOperation, ) -> Result<Value, String>
Answer a device-owner operation from the authenticated hosting shell. This is not an app action and never grants access to a host shell.
§Errors
Refuses unsupported or unavailable device-shell operations.
fn request_device_shell(&mut self) -> bool
fn request_device_shell(&mut self) -> bool
Handle the trusted shell owner selecting the device shell, without granting it.
fn take_save_retry(&mut self) -> bool
fn take_save_retry(&mut self) -> bool
Whether the person asked to try a failed record save again
(crate::SaveAction::Retry on the crate::SaveStatusSurface),
once. The host that owns the record submits its changes again before
it next reports Self::record_save_status.
fn take_host_intent(&mut self) -> Option<AppHostIntent>
fn take_host_intent(&mut self) -> Option<AppHostIntent>
Drain a one-shot request for shell-owned chrome.