pub trait WriteService:
Send
+ Sync
+ 'static {
type Operation: Serialize + DeserializeOwned + Clone + Send + Sync + 'static;
type Prepared: Send + Sync + 'static;
// Required methods
fn validate(&self, operations: &[Self::Operation]) -> Result<(), String>;
fn preflight(
&self,
operations: &[Self::Operation],
) -> Result<Self::Prepared, String>;
fn describe(
&self,
operations: &[Self::Operation],
prepared: &Self::Prepared,
) -> String;
fn write(
&self,
index: usize,
operation: &Self::Operation,
prepared: &Self::Prepared,
) -> Result<Value, String>;
// Provided methods
fn requires_app_approval(&self, _operations: &[Self::Operation]) -> bool { ... }
fn preflight_monitored(
&self,
operations: &[Self::Operation],
monitor: &dyn CallMonitor,
) -> Result<Self::Prepared, String> { ... }
fn write_monitored(
&self,
index: usize,
operation: &Self::Operation,
prepared: &Self::Prepared,
_monitor: &dyn CallMonitor,
) -> Result<Value, String> { ... }
}Expand description
A board’s write actions.
Required Associated Types§
Required Methods§
Sourcefn validate(&self, operations: &[Self::Operation]) -> Result<(), String>
fn validate(&self, operations: &[Self::Operation]) -> Result<(), String>
The checks that need no service call, such as targets in scope.
Sourcefn preflight(
&self,
operations: &[Self::Operation],
) -> Result<Self::Prepared, String>
fn preflight( &self, operations: &[Self::Operation], ) -> Result<Self::Prepared, String>
Reads each target before the approval.
Provided Methods§
Sourcefn requires_app_approval(&self, _operations: &[Self::Operation]) -> bool
fn requires_app_approval(&self, _operations: &[Self::Operation]) -> bool
Config edits and other sensitive operations cannot use client-side or unattended approval. Existing service writes retain normal approval.
Sourcefn preflight_monitored(
&self,
operations: &[Self::Operation],
monitor: &dyn CallMonitor,
) -> Result<Self::Prepared, String>
fn preflight_monitored( &self, operations: &[Self::Operation], monitor: &dyn CallMonitor, ) -> Result<Self::Prepared, String>
Cancellable preflight; existing boards keep their current behavior.
Sourcefn write_monitored(
&self,
index: usize,
operation: &Self::Operation,
prepared: &Self::Prepared,
_monitor: &dyn CallMonitor,
) -> Result<Value, String>
fn write_monitored( &self, index: usize, operation: &Self::Operation, prepared: &Self::Prepared, _monitor: &dyn CallMonitor, ) -> Result<Value, String>
Cancellable active operation; called only after the invocation’s approval.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".