pub struct MemoryReservation { /* private fields */ }Expand description
A unique lease: release it only after the associated allocation has been freed.
Implementations§
Source§impl MemoryReservation
impl MemoryReservation
pub fn bytes(&self) -> usize
pub fn budget(&self) -> &MemoryBudget
Sourcepub fn split(&mut self, bytes: usize) -> Self
pub fn split(&mut self, bytes: usize) -> Self
Transfer part of an existing allocation lease without releasing or reserving bytes.
Panics if bytes exceeds this lease. The original lease is unchanged on failure.
Trait Implementations§
Source§impl Debug for MemoryReservation
impl Debug for MemoryReservation
Source§impl Drop for MemoryReservation
impl Drop for MemoryReservation
Auto Trait Implementations§
impl Freeze for MemoryReservation
impl RefUnwindSafe for MemoryReservation
impl Send for MemoryReservation
impl Sync for MemoryReservation
impl Unpin for MemoryReservation
impl UnsafeUnpin for MemoryReservation
impl UnwindSafe for MemoryReservation
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