pub struct Produced<T> { /* private fields */ }Expand description
A produced value with its existing controlled lease, or an explicit ordinary result. There is no mutable dereference or generic map operation that could replace it with newly allocated, unadmitted payloads.
Implementations§
Source§impl<T> Produced<T>
impl<T> Produced<T>
pub fn reserved_bytes(&self) -> usize
Sourcepub fn into_parts(self) -> (T, Option<MemoryReservation>)
pub fn into_parts(self) -> (T, Option<MemoryReservation>)
Transfer the explicit value/lease pair to its next allocation owner. The caller must retain the lease until those allocations are freed or handed off under a documented legacy API boundary.
Sourcepub fn into_uncontrolled(self) -> Result<T, Self>
pub fn into_uncontrolled(self) -> Result<T, Self>
Extract an ordinary result. A controlled result is returned unchanged instead of silently releasing its lease.
Sourcepub fn into_budgeted(self) -> Result<Budgeted<T>, Self>
pub fn into_budgeted(self) -> Result<Budgeted<T>, Self>
Preserve a controlled result in the existing budgeted carrier. An ordinary result is returned unchanged instead of being retroactively charged.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Produced<T>where
T: Freeze,
impl<T> RefUnwindSafe for Produced<T>where
T: RefUnwindSafe,
impl<T> Send for Produced<T>where
T: Send,
impl<T> Sync for Produced<T>where
T: Sync,
impl<T> Unpin for Produced<T>where
T: Unpin,
impl<T> UnsafeUnpin for Produced<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Produced<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