pub struct UnspillableHeadroomPool { /* private fields */ }Expand description
See the module docs.
Implementations§
Source§impl UnspillableHeadroomPool
impl UnspillableHeadroomPool
Sourcepub fn new(
inner: Arc<dyn MemoryPool>,
pool_size: usize,
headroom: usize,
) -> Self
pub fn new( inner: Arc<dyn MemoryPool>, pool_size: usize, headroom: usize, ) -> Self
Wrap inner (a pool of pool_size bytes), holding headroom back from
spillable consumers.
A headroom of 0, or one at least as large as the pool, disables the
ceiling — the wrapper then delegates everything unchanged rather than
bounding spillers to nothing, which would deadlock every spilling query.
Sourcepub fn spillable_ceiling(&self) -> usize
pub fn spillable_ceiling(&self) -> usize
The ceiling spillable consumers are held to, in bytes.
Trait Implementations§
Source§impl Debug for UnspillableHeadroomPool
impl Debug for UnspillableHeadroomPool
Source§impl Display for UnspillableHeadroomPool
impl Display for UnspillableHeadroomPool
Source§impl MemoryPool for UnspillableHeadroomPool
impl MemoryPool for UnspillableHeadroomPool
Source§fn register(&self, consumer: &MemoryConsumer)
fn register(&self, consumer: &MemoryConsumer)
Registers a new
MemoryConsumer Read moreSource§fn unregister(&self, consumer: &MemoryConsumer)
fn unregister(&self, consumer: &MemoryConsumer)
Source§fn grow(&self, reservation: &MemoryReservation, additional: usize)
fn grow(&self, reservation: &MemoryReservation, additional: usize)
Source§fn shrink(&self, reservation: &MemoryReservation, shrink: usize)
fn shrink(&self, reservation: &MemoryReservation, shrink: usize)
Infallibly shrink the provided
reservation by shrink bytesSource§fn memory_limit(&self) -> MemoryLimit
fn memory_limit(&self) -> MemoryLimit
Return the memory limit of the pool Read more
Auto Trait Implementations§
impl !Freeze for UnspillableHeadroomPool
impl !RefUnwindSafe for UnspillableHeadroomPool
impl !UnwindSafe for UnspillableHeadroomPool
impl Send for UnspillableHeadroomPool
impl Sync for UnspillableHeadroomPool
impl Unpin for UnspillableHeadroomPool
impl UnsafeUnpin for UnspillableHeadroomPool
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request