Trait iota_metrics::monitored_mpsc::WithPermit

source ·
pub trait WithPermit<T> {
    // Required method
    fn with_permit<'life0, 'async_trait, F>(
        &'life0 self,
        f: F,
    ) -> Pin<Box<dyn Future<Output = Option<(Permit<'_, T>, F::Output)>> + Send + 'async_trait>>
       where T: 'static,
             F: 'async_trait + Future + Send,
             Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Sends a value into the channel using the held Permit. After successfully sending the value, it increments the sent gauge (if available) to reflect that an item has been sent.

Required Methods§

source

fn with_permit<'life0, 'async_trait, F>( &'life0 self, f: F, ) -> Pin<Box<dyn Future<Output = Option<(Permit<'_, T>, F::Output)>> + Send + 'async_trait>>
where T: 'static, F: 'async_trait + Future + Send, Self: 'async_trait, 'life0: 'async_trait,

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T: Send> WithPermit<T> for Sender<T>