pub struct CacheObjectResolver { /* private fields */ }Expand description
Resolves dependency index shard files from primary paths or the global cache directory.
Implementations§
Source§impl CacheObjectResolver
impl CacheObjectResolver
Sourcepub fn new(cache_dir: PathBuf) -> Self
pub fn new(cache_dir: PathBuf) -> Self
Creates a new resolver backed by the specified global cache directory.
Sourcepub fn resolve(&mut self, dep: &DependencyShardInfo) -> Option<PathBuf>
pub fn resolve(&mut self, dep: &DependencyShardInfo) -> Option<PathBuf>
Resolves an existing .ridx shard file for the given dependency shard.
Resolution order:
- Exact
dep.object_pathif it exists on disk. cache_object_path(cache_dir, dep.unit_key)if it exists on disk.- Resilient fallback: scans
cache_dir/objects/*/*.ridxfor shards matchingdep.name, strictly requiring exact version and generation match.
Auto Trait Implementations§
impl Forget for CacheObjectResolver
impl Freeze for CacheObjectResolver
impl Move for CacheObjectResolver
impl RefUnwindSafe for CacheObjectResolver
impl Send for CacheObjectResolver
impl Sync for CacheObjectResolver
impl Unpin for CacheObjectResolver
impl UnsafeUnpin for CacheObjectResolver
impl UnwindSafe for CacheObjectResolver
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