pub struct ReadBatch<T> { /* private fields */ }Implementations§
Source§impl<T> ReadBatch<T>
impl<T> ReadBatch<T>
Sourcepub fn try_map<U, E>(
self,
additional_peak: usize,
map: impl FnOnce(T) -> Result<U, E>,
) -> Result<ReadBatch<U>, E>
pub fn try_map<U, E>( self, additional_peak: usize, map: impl FnOnce(T) -> Result<U, E>, ) -> Result<ReadBatch<U>, E>
Consumes a unique owner and preserves its admitted memory through a projection.
additional_peak must bound all new output allocations and conversion scratch
simultaneously live with the input. Private owner growth is admitted separately.
The callback must transfer payload allocations only into its successful value.
Errors and external captures must not retain them. Nested retained pages must
retain or map their own owners.
Admission is nonblocking and happens before the callback. Shared owners are refused; failure consumes this handle. Existing and additional claims remain conservative until their last owner drops, including on independently shared memory claims. No automatic shrinking or payload cloning occurs.
Sourcepub fn try_map_with<U, V, E>(
self,
other: ReadBatch<U>,
additional_peak: usize,
map: impl FnOnce(T, U) -> Result<V, E>,
) -> Result<ReadBatch<V>, E>
pub fn try_map_with<U, V, E>( self, other: ReadBatch<U>, additional_peak: usize, map: impl FnOnce(T, U) -> Result<V, E>, ) -> Result<ReadBatch<V>, E>
Consumes two unique owners while retaining every input memory claim.
The callback has the same peak-allocation and payload-escape obligations as
try_map. Guard-vector replacement and private owner growth are admitted
separately before allocating. Admission never waits and failure consumes
both handles. Shared or weak owner aliases are refused before the callback.
Combining claims does not unify their admission groups. Inputs used by later
dependent reads should originate from the same ReadSession. Nested pages
must continue to retain or map their own guards.
pub fn owner(&self) -> Arc<impl Borrow<T> + Send + Sync + 'static> ⓘ
Trait Implementations§
Source§impl<T: MemorySize> MemorySize for ReadBatch<T>
impl<T: MemorySize> MemorySize for ReadBatch<T>
fn memory_size(&self) -> usize
Source§const INLINE_ONLY: bool = false
const INLINE_ONLY: bool = false
size_of::<Self>() bytes,
with no separately owned allocations or additional accounting charge.