Skip to main content

AppAdapter

Trait AppAdapter 

Source
pub trait AppAdapter: Send + Sync {
Show 14 methods // Required methods fn describe(&self) -> Result<AppSessionDescriptor, ContractError>; fn execute( &mut self, request: &CommandRequest, ) -> Result<CommandReceipt, ContractError>; // Provided methods fn open( &mut self, _document_id: &str, _open_mode: &str, ) -> Result<DecimalU64, ContractError> { ... } fn availability( &self, _target: &CommandTarget, _command_id: &CommandId, ) -> Availability { ... } fn inspect(&self, _target: &CommandTarget) -> Result<Value, ContractError> { ... } fn begin_gesture( &mut self, _session: &GestureSession, ) -> Result<(), ContractError> { ... } fn update_gesture( &mut self, _update: &GestureUpdate, ) -> Result<(), ContractError> { ... } fn commit_gesture( &mut self, _commit: &GestureCommit, ) -> Result<CommandReceipt, ContractError> { ... } fn cancel_gesture( &mut self, _cancel: &GestureCancel, ) -> Result<(), ContractError> { ... } fn snapshot(&self) -> Result<Vec<u8>, ContractError> { ... } fn restore(&mut self, _snapshot_bytes: &[u8]) -> Result<(), ContractError> { ... } fn poll_job(&self, job_id: &str) -> Result<JobDescriptor, ContractError> { ... } fn cancel_job(&mut self, _job_id: &str) -> Result<(), ContractError> { ... } fn close(&mut self) -> Result<(), ContractError> { ... }
}
Expand description

Standardized adapter interface implemented by all application engines.

Ensures uniform hosting across browser Web Workers, native worker processes, and embedded shell stages.

Required Methods§

Source

fn describe(&self) -> Result<AppSessionDescriptor, ContractError>

Return the session and engine metadata descriptor.

Source

fn execute( &mut self, request: &CommandRequest, ) -> Result<CommandReceipt, ContractError>

Execute an authorized command request and return the resulting receipt.

Provided Methods§

Source

fn open( &mut self, _document_id: &str, _open_mode: &str, ) -> Result<DecimalU64, ContractError>

Open or create a document session in the specified mode (“read_only” or “read_write”).

Source

fn availability( &self, _target: &CommandTarget, _command_id: &CommandId, ) -> Availability

Check command availability given the active target and selection.

Source

fn inspect(&self, _target: &CommandTarget) -> Result<Value, ContractError>

Read-only inspection of the specified target object.

Source

fn begin_gesture( &mut self, _session: &GestureSession, ) -> Result<(), ContractError>

Begin an interactive gesture stream.

Source

fn update_gesture( &mut self, _update: &GestureUpdate, ) -> Result<(), ContractError>

Stream incremental pointer updates to the active gesture.

Source

fn commit_gesture( &mut self, _commit: &GestureCommit, ) -> Result<CommandReceipt, ContractError>

Commit an active gesture into an authoritative document revision.

Source

fn cancel_gesture( &mut self, _cancel: &GestureCancel, ) -> Result<(), ContractError>

Cancel an active gesture, discarding in-flight changes and restoring baseline revision.

Source

fn snapshot(&self) -> Result<Vec<u8>, ContractError>

Produce an opaque serialized snapshot of current document state.

Source

fn restore(&mut self, _snapshot_bytes: &[u8]) -> Result<(), ContractError>

Restore document state from a serialized snapshot.

Source

fn poll_job(&self, job_id: &str) -> Result<JobDescriptor, ContractError>

Poll status of a background or asynchronous job.

Source

fn cancel_job(&mut self, _job_id: &str) -> Result<(), ContractError>

Cancel a running background job.

Source

fn close(&mut self) -> Result<(), ContractError>

Close the active document session, releasing held memory and resources.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§