Skip to main content

Callback

Trait Callback 

Source
pub trait Callback
where Self: Send + 'static,
{ // Required method fn send(self, res: Result<(), Error>); }
Expand description

A trait for handling IO operation callbacks.

This trait defines a mechanism to send IO operation results back to the caller, typically used for asynchronous IO operations.

Required Methods§

Source

fn send(self, res: Result<(), Error>)

Sends the result of a IO operation back to the caller.

§Arguments
  • res - The result of the operation, either success (Ok(())) or an IO error

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Callback for SyncSender<Result<(), Error>>

Implementation of the Callback trait for SyncSender.

This allows using a synchronous channel sender as a callback mechanism for IO operations.

Source§

fn send(self, res: Result<(), Error>)

Implementors§