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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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