Trait RecordChanges
pub trait RecordChanges: Send + Sync {
// Required method
fn apply(
&self,
caller: &Caller,
change: &RecordChange,
) -> Result<Value, ActionHostError>;
}Expand description
A host’s door for an agent task’s changes to records outside their apps. A change goes to
the record’s origin, which runs the action against the record as it is then, applies what it
wrote as the task’s step and answers with its JSON: {"ok": {value, resources}, "differs": bool}, or {"failed": why} when the action did not run.
Required Methods§
fn apply(
&self,
caller: &Caller,
change: &RecordChange,
) -> Result<Value, ActionHostError>
fn apply( &self, caller: &Caller, change: &RecordChange, ) -> Result<Value, ActionHostError>
Apply change for caller, as caller may change the record now.
§Errors
ActionHostError::Refused for a caller that is not an agent task acting for its
person or a change the workspace does not allow it, ActionHostError::ConfirmationRequired
for one that asks its person first, ActionHostError::Unavailable when the origin
cannot be reached.