pub struct SessionFind { /* private fields */ }Expand description
A per-session view of the ObjectFront: the object lookup Find
the pack pipelines consume, carrying the session’s lookup-miss slot
(one session’s failed walk cannot leak another’s miss — mint one
with ObjectFront::session). Clones share the slot, the shape the
pipeline’s find.clone() calls assume within one session.
A lookup miss is recorded — the last missed oid — so a failed
walk/count stage maps its not-found error back to the seam’s
StorageError::ObjectMissing abort (SessionFind::missed_object;
the MemFind double’s shape). Misses stay Ok(None); corrupt
entries and backing failures surface as Err.
Implementations§
Source§impl SessionFind
impl SessionFind
Sourcepub fn missed_object(&self) -> Option<ObjectId>
pub fn missed_object(&self) -> Option<ObjectId>
The oid recorded by the latest lookup miss, if any (the recorded id names the missing object rather than the want).
Trait Implementations§
Source§impl Clone for SessionFind
impl Clone for SessionFind
Source§impl Exists for SessionFind
impl Exists for SessionFind
Source§impl Find for SessionFind
impl Find for SessionFind
Source§impl Find for SessionFind
impl Find for SessionFind
Source§fn try_find_cached<'a>(
&self,
id: &oid,
buffer: &'a mut Vec<u8>,
_pack_cache: &mut dyn DecodeEntry,
) -> Result<Option<(Data<'a>, Option<Location>)>>
fn try_find_cached<'a>( &self, id: &oid, buffer: &'a mut Vec<u8>, _pack_cache: &mut dyn DecodeEntry, ) -> Result<Option<(Data<'a>, Option<Location>)>>
Like
Find::try_find(), but with support for controlling the pack cache.
A pack_cache can be used to speed up subsequent lookups, set it to crate::cache::Never if the
workload isn’t suitable for caching. Read moreSource§fn location_by_oid(
&self,
_id: &oid,
_buf: &mut Vec<u8>,
) -> Result<Option<Location>>
fn location_by_oid( &self, _id: &oid, _buf: &mut Vec<u8>, ) -> Result<Option<Location>>
Find the pack location where an object with
id can be found in the database. Read moreSource§fn pack_offsets_and_oid(
&self,
_pack_id: u32,
) -> Result<Option<Vec<(Offset, ObjectId)>>>
fn pack_offsets_and_oid( &self, _pack_id: u32, ) -> Result<Option<Vec<(Offset, ObjectId)>>>
Obtain a vector of all offsets, in index order, along with their object id. Read more
Source§fn try_find<'a>(
&self,
id: &oid,
buffer: &'a mut Vec<u8>,
) -> Result<Option<(Data<'a>, Option<Location>)>, Error>
fn try_find<'a>( &self, id: &oid, buffer: &'a mut Vec<u8>, ) -> Result<Option<(Data<'a>, Option<Location>)>, Error>
Find an object matching
id in the database while placing its raw, decoded data into buffer.
A pack_cache can be used to speed up subsequent lookups, set it to crate::cache::Never if the
workload isn’t suitable for caching. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for SessionFind
impl !UnwindSafe for SessionFind
impl Freeze for SessionFind
impl Send for SessionFind
impl Sync for SessionFind
impl Unpin for SessionFind
impl UnsafeUnpin for SessionFind
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FindExt for T
impl<T> FindExt for T
Source§fn find<'a>(&self, id: &oid, buffer: &'a mut Vec<u8>) -> Result<Data<'a>, Error>
fn find<'a>(&self, id: &oid, buffer: &'a mut Vec<u8>) -> Result<Data<'a>, Error>
Like
try_find(…), but flattens the Result<Option<_>> into a single Result making a non-existing object an error.Source§fn find_blob<'a>(
&self,
id: &oid,
buffer: &'a mut Vec<u8>,
) -> Result<BlobRef<'a>, Error>
fn find_blob<'a>( &self, id: &oid, buffer: &'a mut Vec<u8>, ) -> Result<BlobRef<'a>, Error>
Like
find(…), but flattens the Result<Option<_>> into a single Result making a non-existing object an error
while returning the desired object type.Source§fn find_tree<'a>(
&self,
id: &oid,
buffer: &'a mut Vec<u8>,
) -> Result<TreeRef<'a>, Error>
fn find_tree<'a>( &self, id: &oid, buffer: &'a mut Vec<u8>, ) -> Result<TreeRef<'a>, Error>
Like
find(…), but flattens the Result<Option<_>> into a single Result making a non-existing object an error
while returning the desired object type.Source§fn find_commit<'a>(
&self,
id: &oid,
buffer: &'a mut Vec<u8>,
) -> Result<CommitRef<'a>, Error>
fn find_commit<'a>( &self, id: &oid, buffer: &'a mut Vec<u8>, ) -> Result<CommitRef<'a>, Error>
Like
find(…), but flattens the Result<Option<_>> into a single Result making a non-existing object an error
while returning the desired object type.Source§fn find_tag<'a>(
&self,
id: &oid,
buffer: &'a mut Vec<u8>,
) -> Result<TagRef<'a>, Error>
fn find_tag<'a>( &self, id: &oid, buffer: &'a mut Vec<u8>, ) -> Result<TagRef<'a>, Error>
Like
find(…), but flattens the Result<Option<_>> into a single Result making a non-existing object an error
while returning the desired object type.Source§fn find_commit_iter<'a>(
&self,
id: &oid,
buffer: &'a mut Vec<u8>,
) -> Result<CommitRefIter<'a>, Error>
fn find_commit_iter<'a>( &self, id: &oid, buffer: &'a mut Vec<u8>, ) -> Result<CommitRefIter<'a>, Error>
Like
find(…), but flattens the Result<Option<_>> into a single Result making a non-existing object an error
while returning the desired iterator type.Source§fn find_tree_iter<'a>(
&self,
id: &oid,
buffer: &'a mut Vec<u8>,
) -> Result<TreeRefIter<'a>, Error>
fn find_tree_iter<'a>( &self, id: &oid, buffer: &'a mut Vec<u8>, ) -> Result<TreeRefIter<'a>, Error>
Like
find(…), but flattens the Result<Option<_>> into a single Result making a non-existing object an error
while returning the desired iterator type.Source§fn find_tag_iter<'a>(
&self,
id: &oid,
buffer: &'a mut Vec<u8>,
) -> Result<TagRefIter<'a>, Error>
fn find_tag_iter<'a>( &self, id: &oid, buffer: &'a mut Vec<u8>, ) -> Result<TagRefIter<'a>, Error>
Like
find(…), but flattens the Result<Option<_>> into a single Result making a non-existing object an error
while returning the desired iterator type.Source§impl<T> FindExt for T
impl<T> FindExt for T
Source§fn find<'a>(
&self,
id: &oid,
buffer: &'a mut Vec<u8>,
) -> Result<(Data<'a>, Option<Location>), Error>
fn find<'a>( &self, id: &oid, buffer: &'a mut Vec<u8>, ) -> Result<(Data<'a>, Option<Location>), Error>
Like
try_find(…), but flattens the Result<Option<_>> into a single Result making a non-existing object an error.Source§fn find_commit<'a>(
&self,
id: &oid,
buffer: &'a mut Vec<u8>,
) -> Result<(CommitRef<'a>, Option<Location>), Error>
fn find_commit<'a>( &self, id: &oid, buffer: &'a mut Vec<u8>, ) -> Result<(CommitRef<'a>, Option<Location>), Error>
Like
find(…), but flattens the Result<Option<_>> into a single Result making a non-existing object an error
while returning the desired object type.Source§fn find_tree<'a>(
&self,
id: &oid,
buffer: &'a mut Vec<u8>,
) -> Result<(TreeRef<'a>, Option<Location>), Error>
fn find_tree<'a>( &self, id: &oid, buffer: &'a mut Vec<u8>, ) -> Result<(TreeRef<'a>, Option<Location>), Error>
Like
find(…), but flattens the Result<Option<_>> into a single Result making a non-existing object an error
while returning the desired object type.Source§fn find_tag<'a>(
&self,
id: &oid,
buffer: &'a mut Vec<u8>,
) -> Result<(TagRef<'a>, Option<Location>), Error>
fn find_tag<'a>( &self, id: &oid, buffer: &'a mut Vec<u8>, ) -> Result<(TagRef<'a>, Option<Location>), Error>
Like
find(…), but flattens the Result<Option<_>> into a single Result making a non-existing object an error
while returning the desired object type.Source§fn find_blob<'a>(
&self,
id: &oid,
buffer: &'a mut Vec<u8>,
) -> Result<(BlobRef<'a>, Option<Location>), Error>
fn find_blob<'a>( &self, id: &oid, buffer: &'a mut Vec<u8>, ) -> Result<(BlobRef<'a>, Option<Location>), Error>
Like
find(…), but flattens the Result<Option<_>> into a single Result making a non-existing object an error
while returning the desired object type.Source§fn find_commit_iter<'a>(
&self,
id: &oid,
buffer: &'a mut Vec<u8>,
) -> Result<(CommitRefIter<'a>, Option<Location>), Error>
fn find_commit_iter<'a>( &self, id: &oid, buffer: &'a mut Vec<u8>, ) -> Result<(CommitRefIter<'a>, Option<Location>), Error>
Like
find(…), but flattens the Result<Option<_>> into a single Result making a non-existing object an error
while returning the desired iterator type.