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
Share an immutable result and its existing lease. The shared payload is admitted before allocation; reference-count bookkeeping is outside the payload allowance.
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.