Skip to main content

ArcSendCallback

Type Alias ArcSendCallback 

Source
pub type ArcSendCallback = Arc<dyn SendCallback>;
Expand description

Type alias for dynamically dispatched send callbacks.

Use this type when storing callbacks in struct fields or when the callback type cannot be determined at compile time. For function parameters, prefer generic bounds over SendCallback to enable monomorphization.

§Examples

ⓘ
struct ProducerState {
    pending: Vec<ArcSendCallback>,
}

impl ProducerState {
    fn add<CB: SendCallback + 'static>(&mut self, callback: CB) {
        self.pending.push(Arc::new(callback));
    }
}

Aliased Type§

pub struct ArcSendCallback { /* private fields */ }