pub trait VM: Sized {
Show 35 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) -> Bytes;
fn is_ready_to_execute(&self) -> VMResult<bool>;
fn is_completed(&self, handle: NotificationHandle) -> bool;
fn do_await(
&mut self,
unresolved_future: UnresolvedFuture,
) -> VMResult<AwaitResponse>;
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,
options: PayloadOptions,
) -> VMResult<NotificationHandle>;
fn sys_state_get_keys(&mut self) -> VMResult<NotificationHandle>;
fn sys_state_set(
&mut self,
key: String,
value: Bytes,
options: PayloadOptions,
) -> 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,
name: Option<String>,
options: PayloadOptions,
) -> VMResult<CallHandle>;
fn sys_send(
&mut self,
target: Target,
input: Bytes,
execution_time_since_unix_epoch: Option<Duration>,
name: Option<String>,
options: PayloadOptions,
) -> VMResult<SendHandle>;
fn sys_awakeable(&mut self) -> VMResult<AwakeableHandle>;
fn sys_complete_awakeable(
&mut self,
id: String,
value: NonEmptyValue,
options: PayloadOptions,
) -> 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,
options: PayloadOptions,
) -> VMResult<NotificationHandle>;
fn sys_run(&mut self, name: String) -> VMResult<RunHandle>;
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,
options: PayloadOptions,
) -> VMResult<()>;
fn sys_end(&mut self) -> VMResult<()>;
fn state(&self) -> State;
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>, )
Sourcefn take_output(&mut self) -> Bytes
fn take_output(&mut self) -> Bytes
Returns all the bytes currently buffered in the output buffer.
fn is_ready_to_execute(&self) -> VMResult<bool>
fn is_completed(&self, handle: NotificationHandle) -> bool
fn do_await( &mut self, unresolved_future: UnresolvedFuture, ) -> VMResult<AwaitResponse>
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, options: PayloadOptions, ) -> VMResult<NotificationHandle>
fn sys_state_get_keys(&mut self) -> VMResult<NotificationHandle>
fn sys_state_set( &mut self, key: String, value: Bytes, options: PayloadOptions, ) -> 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, name: Option<String>, options: PayloadOptions, ) -> VMResult<CallHandle>
fn sys_send( &mut self, target: Target, input: Bytes, execution_time_since_unix_epoch: Option<Duration>, name: Option<String>, options: PayloadOptions, ) -> VMResult<SendHandle>
fn sys_awakeable(&mut self) -> VMResult<AwakeableHandle>
fn sys_complete_awakeable( &mut self, id: String, value: NonEmptyValue, options: PayloadOptions, ) -> 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, options: PayloadOptions, ) -> VMResult<NotificationHandle>
fn sys_run(&mut self, name: String) -> VMResult<RunHandle>
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, options: PayloadOptions, ) -> VMResult<()>
fn sys_end(&mut self) -> VMResult<()>
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".