pub struct OwnedReadSession<S: Store> { /* private fields */ }Expand description
An owned, root-bound read context suitable for long-lived native binding
handles. Unlike ReadSession, this type owns both manager and tree state,
so foreign-language adapters can reuse retained routing state across calls.
Stateful point reads are synchronized. High-concurrency callers should use one session per worker rather than sharing one session across all workers.
Implementations§
Source§impl<S: Store> OwnedReadSession<S>
impl<S: Store> OwnedReadSession<S>
Sourcepub fn get_with<R>(
&self,
key: &[u8],
read: impl FnOnce(&[u8]) -> R,
) -> Result<Option<R>, Error>
pub fn get_with<R>( &self, key: &[u8], read: impl FnOnce(&[u8]) -> R, ) -> Result<Option<R>, Error>
Read a value without allocating it while retaining root and route state across calls.
Sourcepub fn get_lease(&self, key: &[u8]) -> Result<Option<OwnedValueLease>, Error>
pub fn get_lease(&self, key: &[u8]) -> Result<Option<OwnedValueLease>, Error>
Retain the packed leaf containing a value. This is intended for native adapters that expose a callback-scoped view and release it deterministically when the callback returns.
Sourcepub fn get_many(&self, keys: &[Vec<u8>]) -> Result<Vec<Option<Vec<u8>>>, Error>
pub fn get_many(&self, keys: &[Vec<u8>]) -> Result<Vec<Option<Vec<u8>>>, Error>
Read keys in caller order while holding the session state once.
Sourcepub fn get_many_with<K, F>(&self, keys: &[K], visit: F) -> Result<(), Error>
pub fn get_many_with<K, F>(&self, keys: &[K], visit: F) -> Result<(), Error>
Visit batch point-read results in input order while sharing route work.
Sourcepub fn scan_range_until<B>(
&self,
start: &[u8],
end: Option<&[u8]>,
visit: impl for<'entry> FnMut(EntryRef<'entry>) -> ControlFlow<B>,
) -> Result<ScanOutcome<B>, Error>
pub fn scan_range_until<B>( &self, start: &[u8], end: Option<&[u8]>, visit: impl for<'entry> FnMut(EntryRef<'entry>) -> ControlFlow<B>, ) -> Result<ScanOutcome<B>, Error>
Visit a half-open range. The owned session keeps the root warm; the traversal itself remains borrowed and callback-scoped.
Sourcepub fn scan_range_diff_until<B>(
&self,
other: &Self,
start: &[u8],
end: Option<&[u8]>,
visit: impl for<'diff> FnMut(DiffRef<'diff>) -> ControlFlow<B>,
) -> Result<ScanOutcome<B>, Error>
pub fn scan_range_diff_until<B>( &self, other: &Self, start: &[u8], end: Option<&[u8]>, visit: impl for<'diff> FnMut(DiffRef<'diff>) -> ControlFlow<B>, ) -> Result<ScanOutcome<B>, Error>
Visit differences between two root-bound sessions without copying diff fields. Both sessions must come from the same manager/store identity.
Sourcepub fn scan_conflicts_until<B>(
&self,
left: &Self,
right: &Self,
visit: impl for<'conflict> FnMut(ConflictRef<'conflict>) -> ControlFlow<B>,
) -> Result<ScanOutcome<B>, Error>
pub fn scan_conflicts_until<B>( &self, left: &Self, right: &Self, visit: impl for<'conflict> FnMut(ConflictRef<'conflict>) -> ControlFlow<B>, ) -> Result<ScanOutcome<B>, Error>
Visit genuine three-way conflicts between compatible root-bound sessions. The receiver is the merge base.
Sourcepub fn scan_range_session(
&self,
start: &[u8],
end: Option<&[u8]>,
) -> Result<OwnedRangeScanSession<S>, Error>
pub fn scan_range_session( &self, start: &[u8], end: Option<&[u8]>, ) -> Result<OwnedRangeScanSession<S>, Error>
Open a retained forward traversal that seeks once and continues from the same native stack across pages.
Auto Trait Implementations§
impl<S> !Freeze for OwnedReadSession<S>
impl<S> RefUnwindSafe for OwnedReadSession<S>where
S: RefUnwindSafe,
impl<S> Send for OwnedReadSession<S>
impl<S> Sync for OwnedReadSession<S>
impl<S> Unpin for OwnedReadSession<S>
impl<S> UnsafeUnpin for OwnedReadSession<S>
impl<S> UnwindSafe for OwnedReadSession<S>where
S: RefUnwindSafe,
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more