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§
Sourcefn describe(&self) -> Result<AppSessionDescriptor, ContractError>
fn describe(&self) -> Result<AppSessionDescriptor, ContractError>
Return the session and engine metadata descriptor.
Sourcefn execute(
&mut self,
request: &CommandRequest,
) -> Result<CommandReceipt, ContractError>
fn execute( &mut self, request: &CommandRequest, ) -> Result<CommandReceipt, ContractError>
Execute an authorized command request and return the resulting receipt.
Provided Methods§
Sourcefn open(
&mut self,
_document_id: &str,
_open_mode: &str,
) -> Result<DecimalU64, ContractError>
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”).
Sourcefn availability(
&self,
_target: &CommandTarget,
_command_id: &CommandId,
) -> Availability
fn availability( &self, _target: &CommandTarget, _command_id: &CommandId, ) -> Availability
Check command availability given the active target and selection.
Sourcefn inspect(&self, _target: &CommandTarget) -> Result<Value, ContractError>
fn inspect(&self, _target: &CommandTarget) -> Result<Value, ContractError>
Read-only inspection of the specified target object.
Sourcefn begin_gesture(
&mut self,
_session: &GestureSession,
) -> Result<(), ContractError>
fn begin_gesture( &mut self, _session: &GestureSession, ) -> Result<(), ContractError>
Begin an interactive gesture stream.
Sourcefn update_gesture(
&mut self,
_update: &GestureUpdate,
) -> Result<(), ContractError>
fn update_gesture( &mut self, _update: &GestureUpdate, ) -> Result<(), ContractError>
Stream incremental pointer updates to the active gesture.
Sourcefn commit_gesture(
&mut self,
_commit: &GestureCommit,
) -> Result<CommandReceipt, ContractError>
fn commit_gesture( &mut self, _commit: &GestureCommit, ) -> Result<CommandReceipt, ContractError>
Commit an active gesture into an authoritative document revision.
Sourcefn cancel_gesture(
&mut self,
_cancel: &GestureCancel,
) -> Result<(), ContractError>
fn cancel_gesture( &mut self, _cancel: &GestureCancel, ) -> Result<(), ContractError>
Cancel an active gesture, discarding in-flight changes and restoring baseline revision.
Sourcefn snapshot(&self) -> Result<Vec<u8>, ContractError>
fn snapshot(&self) -> Result<Vec<u8>, ContractError>
Produce an opaque serialized snapshot of current document state.
Sourcefn restore(&mut self, _snapshot_bytes: &[u8]) -> Result<(), ContractError>
fn restore(&mut self, _snapshot_bytes: &[u8]) -> Result<(), ContractError>
Restore document state from a serialized snapshot.
Sourcefn poll_job(&self, job_id: &str) -> Result<JobDescriptor, ContractError>
fn poll_job(&self, job_id: &str) -> Result<JobDescriptor, ContractError>
Poll status of a background or asynchronous job.
Sourcefn cancel_job(&mut self, _job_id: &str) -> Result<(), ContractError>
fn cancel_job(&mut self, _job_id: &str) -> Result<(), ContractError>
Cancel a running background job.
Sourcefn close(&mut self) -> Result<(), ContractError>
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".