Trait VM

Source
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§

Source

fn new(request_headers: impl HeaderMap, options: VMOptions) -> VMResult<Self>

Source

fn get_response_head(&self) -> ResponseHead

Source

fn notify_input(&mut self, buffer: Bytes)

Source

fn notify_input_closed(&mut self)

Source

fn notify_error( &mut self, error: Error, related_command: Option<CommandRelationship>, )

Source

fn take_output(&mut self) -> TakeOutputResult

Source

fn is_ready_to_execute(&self) -> VMResult<bool>

Source

fn is_completed(&self, handle: NotificationHandle) -> bool

Source

fn do_progress( &mut self, any_handle: Vec<NotificationHandle>, ) -> VMResult<DoProgressResponse>

Source

fn take_notification( &mut self, handle: NotificationHandle, ) -> VMResult<Option<Value>>

Source

fn sys_input(&mut self) -> VMResult<Input>

Source

fn sys_state_get(&mut self, key: String) -> VMResult<NotificationHandle>

Source

fn sys_state_get_keys(&mut self) -> VMResult<NotificationHandle>

Source

fn sys_state_set(&mut self, key: String, value: Bytes) -> VMResult<()>

Source

fn sys_state_clear(&mut self, key: String) -> VMResult<()>

Source

fn sys_state_clear_all(&mut self) -> VMResult<()>

Source

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

Source

fn sys_call(&mut self, target: Target, input: Bytes) -> VMResult<CallHandle>

Source

fn sys_send( &mut self, target: Target, input: Bytes, execution_time_since_unix_epoch: Option<Duration>, ) -> VMResult<SendHandle>

Source

fn sys_awakeable(&mut self) -> VMResult<(String, NotificationHandle)>

Source

fn sys_complete_awakeable( &mut self, id: String, value: NonEmptyValue, ) -> VMResult<()>

Source

fn create_signal_handle( &mut self, signal_name: String, ) -> VMResult<NotificationHandle>

Source

fn sys_complete_signal( &mut self, target_invocation_id: String, signal_name: String, value: NonEmptyValue, ) -> VMResult<()>

Source

fn sys_get_promise(&mut self, key: String) -> VMResult<NotificationHandle>

Source

fn sys_peek_promise(&mut self, key: String) -> VMResult<NotificationHandle>

Source

fn sys_complete_promise( &mut self, key: String, value: NonEmptyValue, ) -> VMResult<NotificationHandle>

Source

fn sys_run(&mut self, name: String) -> VMResult<NotificationHandle>

Source

fn propose_run_completion( &mut self, notification_handle: NotificationHandle, value: RunExitResult, retry_policy: RetryPolicy, ) -> VMResult<()>

Source

fn sys_cancel_invocation( &mut self, target_invocation_id: String, ) -> VMResult<()>

Source

fn sys_attach_invocation( &mut self, target: AttachInvocationTarget, ) -> VMResult<NotificationHandle>

Source

fn sys_get_invocation_output( &mut self, target: AttachInvocationTarget, ) -> VMResult<NotificationHandle>

Source

fn sys_write_output(&mut self, value: NonEmptyValue) -> VMResult<()>

Source

fn sys_end(&mut self) -> VMResult<()>

Source

fn is_waiting_preflight(&self) -> bool

Source

fn is_replaying(&self) -> bool

Source

fn is_processing(&self) -> bool

Returns true if the state machine is in processing state

Source

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.

Implementors§