pub struct ReadSession<C = ()> { /* private fields */ }Expand description
Shared admission context for one composed read operation.
A session does not freeze cursors or create a transaction snapshot. Its readers, point reads and collections share memory dependencies. Grouped reader creation refuses saturated active slots instead of waiting on another reader in the group. Returned owners remain valid and charged after the session drops.
Implementations§
Source§impl<C> ReadSession<C>where
C: ObjectCatalog,
impl<C> ReadSession<C>where
C: ObjectCatalog,
pub async fn read_object<T>(
&self,
key: &<T as StoredObject>::Key,
version: ObjectVersion,
) -> Result<Option<ReadBatch<ObjectRevision<T>>>, Error>where
T: StoredObject,
C: Contains<T>,
Source§impl<C> ReadSession<C>
impl<C> ReadSession<C>
Source§impl<C> ReadSession<C>where
C: ObjectCatalog,
impl<C> ReadSession<C>where
C: ObjectCatalog,
pub async fn read_objects<T>(
&self,
read: ObjectRead<'_, T>,
) -> Result<ObjectReader<T>, Error>where
T: StoredObject,
C: Contains<T>,
Source§impl<C> ReadSession<C>
impl<C> ReadSession<C>
pub async fn read_records<T>(
&self,
read: RecordRead,
) -> Result<RecordReader<T>, Error>where
T: Message + MemorySize,
Source§impl<C> ReadSession<C>
impl<C> ReadSession<C>
Sourcepub fn try_memory(
&self,
payload_bytes: NonZero<usize>,
) -> Result<RetainedMemory, Error>
pub fn try_memory( &self, payload_bytes: NonZero<usize>, ) -> Result<RetainedMemory, Error>
Admits mutable metadata capacity in this session without waiting.
The claim includes a private owner allowance. Keep metadata and its claim
under the same owner, and use try_grow_by before allocating incremental
keys, nodes, replacement buffers or cursor metadata. Failed growth leaves
existing data and admission unchanged.
pub async fn read_file(&self, request: ReadFile) -> Result<FileReader, Error>
Sourcepub fn collection<U>(&self) -> Result<ReadBatch<Vec<ReadBatch<U>>>, Error>where
U: MemorySize,
pub fn collection<U>(&self) -> Result<ReadBatch<Vec<ReadBatch<U>>>, Error>where
U: MemorySize,
Creates an empty retained collection for this session’s projected pages.
Grow the outer Vec through ReadBatch::try_map, admitting the full temporary
replacement backing before allocating it. Child pages retain their own claims.
Keep dependent reads in this session; unrelated groups do not share its Held.
Trait Implementations§
Source§impl<C> Clone for ReadSession<C>
impl<C> Clone for ReadSession<C>
Source§fn clone(&self) -> ReadSession<C>
fn clone(&self) -> ReadSession<C>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more