pub trait ExecProcess: Send + Sync {
// Required methods
fn process_id(&self) -> &ProcessId;
fn subscribe_wake(&self) -> Receiver<u64>;
fn subscribe_events(&self) -> ExecProcessEventReceiver;
fn read(
&self,
after_seq: Option<u64>,
max_bytes: Option<usize>,
wait_ms: Option<u64>,
) -> ExecProcessFuture<'_, ReadResponse>;
fn write(&self, chunk: Vec<u8>) -> ExecProcessFuture<'_, WriteResponse>;
fn signal(&self, signal: ProcessSignal) -> ExecProcessFuture<'_, ()>;
fn terminate(&self) -> ExecProcessFuture<'_, ()>;
}Expand description
Handle for an executor-managed process.
Implementations must support both retained-output reads and pushed events:
read is the request/response API for callers that want to page through
buffered output, while subscribe_events is the streaming API for callers
that want output and lifecycle changes delivered as they happen.
Required Methods§
fn process_id(&self) -> &ProcessId
fn subscribe_wake(&self) -> Receiver<u64>
fn subscribe_events(&self) -> ExecProcessEventReceiver
fn read( &self, after_seq: Option<u64>, max_bytes: Option<usize>, wait_ms: Option<u64>, ) -> ExecProcessFuture<'_, ReadResponse>
fn write(&self, chunk: Vec<u8>) -> ExecProcessFuture<'_, WriteResponse>
fn signal(&self, signal: ProcessSignal) -> ExecProcessFuture<'_, ()>
fn terminate(&self) -> ExecProcessFuture<'_, ()>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".