iota_metrics::monitored_mpsc

Trait 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,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

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