pub trait BytePermits: Send + Sync {
// Required method
async fn acquire(&self, n_bytes: usize) -> Permit;
}Expand description
Backpressure permit trait.
Implementations control write pump flow based on byte counts.
Native async-fn-in-trait rather than #[async_trait]: acquire is on the
per-write flow-control path, so the box-per-call async_trait added was pure
overhead. The trait is used behind generics, never as dyn BytePermits.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".