Struct tame_index::index::local::LocalRegistry
source · pub struct LocalRegistry { /* private fields */ }
Available on crate feature
local
only.Expand description
A local registry implementation
Implementations§
source§impl LocalRegistry
impl LocalRegistry
sourcepub fn open(path: PathBuf, validate: bool) -> Result<Self, Error>
pub fn open(path: PathBuf, validate: bool) -> Result<Self, Error>
Opens an existing local registry, optionally validating it
sourcepub fn validate(path: &Path) -> Result<(), Error>
pub fn validate(path: &Path) -> Result<(), Error>
Validates the specified path contains a local registry
Validation ensures every crate file matches the expected according to the index entry for the crate
sourcepub fn cached_krate(
&self,
name: KrateName<'_>,
_lock: &FileLock
) -> Result<Option<IndexKrate>, Error>
pub fn cached_krate( &self, name: KrateName<'_>, _lock: &FileLock ) -> Result<Option<IndexKrate>, Error>
Gets the index information for the crate
Note this naming is just to be consistent with crate::SparseIndex
and
crate::GitIndex
, local registries do not have a .cache in the index
sourcepub fn krate_path(&self, name: KrateName<'_>) -> PathBuf
pub fn krate_path(&self, name: KrateName<'_>) -> PathBuf
Gets the path to the index entry for the krate.
Note that unlike .cache entries for git and sparse indices, these are not binary files, they are just the JSON line format
Trait Implementations§
source§impl From<LocalRegistry> for ComboIndex
Available on crate features git
and sparse
only.
impl From<LocalRegistry> for ComboIndex
Available on crate features
git
and sparse
only.source§fn from(local: LocalRegistry) -> Self
fn from(local: LocalRegistry) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for LocalRegistry
impl RefUnwindSafe for LocalRegistry
impl Send for LocalRegistry
impl Sync for LocalRegistry
impl Unpin for LocalRegistry
impl UnwindSafe for LocalRegistry
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