pub struct Budgeted<T> { /* private fields */ }Expand description
An immutable result and its owned allocations. Cloning the value is a separate allocation.
Implementations§
Source§impl<T> Budgeted<T>
impl<T> Budgeted<T>
Sourcepub fn new(value: T, memory: MemoryReservation) -> Self
pub fn new(value: T, memory: MemoryReservation) -> Self
The caller must associate all owned allocations with this reservation.
pub fn reserved_bytes(&self) -> usize
Share the immutable value and its lease, reserving the shared payload before allocation. Reference-count bookkeeping is outside the payload allowance.
Sourcepub fn into_parts(self) -> (T, MemoryReservation)
pub fn into_parts(self) -> (T, MemoryReservation)
Move the value and lease together to another allocation owner.
Trait Implementations§
impl<T: Eq> Eq for Budgeted<T>
Auto Trait Implementations§
impl<T> Freeze for Budgeted<T>where
T: Freeze,
impl<T> RefUnwindSafe for Budgeted<T>where
T: RefUnwindSafe,
impl<T> Send for Budgeted<T>where
T: Send,
impl<T> Sync for Budgeted<T>where
T: Sync,
impl<T> Unpin for Budgeted<T>where
T: Unpin,
impl<T> UnsafeUnpin for Budgeted<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Budgeted<T>where
T: UnwindSafe,
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