Skip to main content

CompletionSink

Trait CompletionSink 

Source
pub trait CompletionSink: Send + Sync {
    // Required methods
    fn complete(&self, cmd_id: CommandId, result_bytes: &[u8]);
    fn fail(&self, cmd_id: CommandId, detail: &str);
}
Expand description

Cross-thread completion delivery. Sinks take borrowed slices and must copy into framework-owned storage before returning (Principle 1a: external byte payloads are ephemeral).

Required Methods§

Source

fn complete(&self, cmd_id: CommandId, result_bytes: &[u8])

Deliver a successful completion. Implementation copies bytes.

Source

fn fail(&self, cmd_id: CommandId, detail: &str)

Deliver a failure with Display rendering of the error.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§