pub(crate) struct MemoryQuota<M: MemoryMetrics> {
pub(crate) semaphore: Arc<Semaphore>,
pub(crate) limit_permits: u32,
pub(crate) granularity: PermitGranularity,
pub(crate) metrics: M,
}Fields§
§semaphore: Arc<Semaphore>§limit_permits: u32§granularity: PermitGranularity§metrics: MImplementations§
Source§impl<M: MemoryMetrics> MemoryQuota<M>
impl<M: MemoryMetrics> MemoryQuota<M>
pub(crate) fn bytes_to_permits(&self, bytes: u64) -> u32
pub(crate) fn permits_to_bytes(&self, permits: u32) -> u64
pub(crate) fn used_permits(&self) -> u32
pub(crate) fn available_permits_clamped(&self) -> u32
pub(crate) fn update_in_use_metric(&self)
pub(crate) fn release_permit(&self, permit: OwnedSemaphorePermit)
Trait Implementations§
Source§impl<M: Clone + MemoryMetrics> Clone for MemoryQuota<M>
impl<M: Clone + MemoryMetrics> Clone for MemoryQuota<M>
Source§fn clone(&self) -> MemoryQuota<M>
fn clone(&self) -> MemoryQuota<M>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<M> Freeze for MemoryQuota<M>where
M: Freeze,
impl<M> !RefUnwindSafe for MemoryQuota<M>
impl<M> Send for MemoryQuota<M>
impl<M> Sync for MemoryQuota<M>
impl<M> Unpin for MemoryQuota<M>where
M: Unpin,
impl<M> UnsafeUnpin for MemoryQuota<M>where
M: UnsafeUnpin,
impl<M> !UnwindSafe for MemoryQuota<M>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].