pub trait VM: Sized {
Show 37 methods
// Required methods
fn new(
request_headers: impl HeaderMap,
options: VMOptions,
) -> VMResult<Self>;
fn get_response_head(&self) -> ResponseHead;
fn notify_input(&mut self, buffer: Bytes);
fn notify_input_closed(&mut self);
fn notify_error(
&mut self,
error: Error,
related_command: Option<CommandRelationship>,
);
fn take_output(&mut self) -> TakeOutputResult;
fn is_ready_to_execute(&self) -> VMResult<bool>;
fn is_completed(&self, handle: NotificationHandle) -> bool;
fn do_progress(
&mut self,
any_handle: Vec<NotificationHandle>,
) -> VMResult<DoProgressResponse>;
fn take_notification(
&mut self,
handle: NotificationHandle,
) -> VMResult<Option<Value>>;
fn sys_input(&mut self) -> VMResult<Input>;
fn sys_state_get(&mut self, key: String) -> VMResult<NotificationHandle>;
fn sys_state_get_keys(&mut self) -> VMResult<NotificationHandle>;
fn sys_state_set(&mut self, key: String, value: Bytes) -> VMResult<()>;
fn sys_state_clear(&mut self, key: String) -> VMResult<()>;
fn sys_state_clear_all(&mut self) -> VMResult<()>;
fn sys_sleep(
&mut self,
name: String,
wake_up_time_since_unix_epoch: Duration,
now_since_unix_epoch: Option<Duration>,
) -> VMResult<NotificationHandle>;
fn sys_call(&mut self, target: Target, input: Bytes) -> VMResult<CallHandle>;
fn sys_send(
&mut self,
target: Target,
input: Bytes,
execution_time_since_unix_epoch: Option<Duration>,
) -> VMResult<SendHandle>;
fn sys_awakeable(&mut self) -> VMResult<(String, NotificationHandle)>;
fn sys_complete_awakeable(
&mut self,
id: String,
value: NonEmptyValue,
) -> VMResult<()>;
fn create_signal_handle(
&mut self,
signal_name: String,
) -> VMResult<NotificationHandle>;
fn sys_complete_signal(
&mut self,
target_invocation_id: String,
signal_name: String,
value: NonEmptyValue,
) -> VMResult<()>;
fn sys_get_promise(&mut self, key: String) -> VMResult<NotificationHandle>;
fn sys_peek_promise(&mut self, key: String) -> VMResult<NotificationHandle>;
fn sys_complete_promise(
&mut self,
key: String,
value: NonEmptyValue,
) -> VMResult<NotificationHandle>;
fn sys_run(&mut self, name: String) -> VMResult<NotificationHandle>;
fn propose_run_completion(
&mut self,
notification_handle: NotificationHandle,
value: RunExitResult,
retry_policy: RetryPolicy,
) -> VMResult<()>;
fn sys_cancel_invocation(
&mut self,
target_invocation_id: String,
) -> VMResult<()>;
fn sys_attach_invocation(
&mut self,
target: AttachInvocationTarget,
) -> VMResult<NotificationHandle>;
fn sys_get_invocation_output(
&mut self,
target: AttachInvocationTarget,
) -> VMResult<NotificationHandle>;
fn sys_write_output(&mut self, value: NonEmptyValue) -> VMResult<()>;
fn sys_end(&mut self) -> VMResult<()>;
fn is_waiting_preflight(&self) -> bool;
fn is_replaying(&self) -> bool;
fn is_processing(&self) -> bool;
fn last_command_index(&self) -> i64;
}
Required Methods§
fn new(request_headers: impl HeaderMap, options: VMOptions) -> VMResult<Self>
fn get_response_head(&self) -> ResponseHead
fn notify_input(&mut self, buffer: Bytes)
fn notify_input_closed(&mut self)
fn notify_error( &mut self, error: Error, related_command: Option<CommandRelationship>, )
fn take_output(&mut self) -> TakeOutputResult
fn is_ready_to_execute(&self) -> VMResult<bool>
fn is_completed(&self, handle: NotificationHandle) -> bool
fn do_progress( &mut self, any_handle: Vec<NotificationHandle>, ) -> VMResult<DoProgressResponse>
fn take_notification( &mut self, handle: NotificationHandle, ) -> VMResult<Option<Value>>
fn sys_input(&mut self) -> VMResult<Input>
fn sys_state_get(&mut self, key: String) -> VMResult<NotificationHandle>
fn sys_state_get_keys(&mut self) -> VMResult<NotificationHandle>
fn sys_state_set(&mut self, key: String, value: Bytes) -> VMResult<()>
fn sys_state_clear(&mut self, key: String) -> VMResult<()>
fn sys_state_clear_all(&mut self) -> VMResult<()>
Sourcefn sys_sleep(
&mut self,
name: String,
wake_up_time_since_unix_epoch: Duration,
now_since_unix_epoch: Option<Duration>,
) -> VMResult<NotificationHandle>
fn sys_sleep( &mut self, name: String, wake_up_time_since_unix_epoch: Duration, now_since_unix_epoch: Option<Duration>, ) -> VMResult<NotificationHandle>
Note: now_since_unix_epoch
is only used for debugging purposes
fn sys_call(&mut self, target: Target, input: Bytes) -> VMResult<CallHandle>
fn sys_send( &mut self, target: Target, input: Bytes, execution_time_since_unix_epoch: Option<Duration>, ) -> VMResult<SendHandle>
fn sys_awakeable(&mut self) -> VMResult<(String, NotificationHandle)>
fn sys_complete_awakeable( &mut self, id: String, value: NonEmptyValue, ) -> VMResult<()>
fn create_signal_handle( &mut self, signal_name: String, ) -> VMResult<NotificationHandle>
fn sys_complete_signal( &mut self, target_invocation_id: String, signal_name: String, value: NonEmptyValue, ) -> VMResult<()>
fn sys_get_promise(&mut self, key: String) -> VMResult<NotificationHandle>
fn sys_peek_promise(&mut self, key: String) -> VMResult<NotificationHandle>
fn sys_complete_promise( &mut self, key: String, value: NonEmptyValue, ) -> VMResult<NotificationHandle>
fn sys_run(&mut self, name: String) -> VMResult<NotificationHandle>
fn propose_run_completion( &mut self, notification_handle: NotificationHandle, value: RunExitResult, retry_policy: RetryPolicy, ) -> VMResult<()>
fn sys_cancel_invocation( &mut self, target_invocation_id: String, ) -> VMResult<()>
fn sys_attach_invocation( &mut self, target: AttachInvocationTarget, ) -> VMResult<NotificationHandle>
fn sys_get_invocation_output( &mut self, target: AttachInvocationTarget, ) -> VMResult<NotificationHandle>
fn sys_write_output(&mut self, value: NonEmptyValue) -> VMResult<()>
fn sys_end(&mut self) -> VMResult<()>
fn is_waiting_preflight(&self) -> bool
fn is_replaying(&self) -> bool
Sourcefn is_processing(&self) -> bool
fn is_processing(&self) -> bool
Returns true if the state machine is in processing state
Sourcefn last_command_index(&self) -> i64
fn last_command_index(&self) -> i64
Returns last command index. Returns -1
if there was no progress in the journal.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.