Struct tame_index::index::RemoteGitIndex
source · pub struct RemoteGitIndex { /* private fields */ }
git
only.Expand description
Uses a “bare” git index that fetches files directly from the repo instead of using a local checkout, the same as cargo itself.
Uses cargo’s cache
Implementations§
source§impl RemoteGitIndex
impl RemoteGitIndex
sourcepub fn into_parts(self) -> (GitIndex, Repository)
pub fn into_parts(self) -> (GitIndex, Repository)
Breaks Self
into its component parts
This method is useful if you need thread safe access to the repository
sourcepub fn with_options<P>(
index: GitIndex,
progress: P,
should_interrupt: &AtomicBool,
_lock: &FileLock
) -> Result<Self, Error>where
P: NestedProgress,
P::SubProgress: 'static,
pub fn with_options<P>(
index: GitIndex,
progress: P,
should_interrupt: &AtomicBool,
_lock: &FileLock
) -> Result<Self, Error>where
P: NestedProgress,
P::SubProgress: 'static,
Creates a new Self
that allows showing of progress of the the potential
fetch if the disk location is empty, as well as allowing interruption
of the fetch operation.
sourcepub fn index_config(&self) -> Result<IndexConfig, Error>
pub fn index_config(&self) -> Result<IndexConfig, Error>
Get the configuration of the index.
See the cargo docs
sourcepub fn krate(
&self,
name: KrateName<'_>,
write_cache_entry: bool,
lock: &FileLock
) -> Result<Option<IndexKrate>, Error>
pub fn krate( &self, name: KrateName<'_>, write_cache_entry: bool, lock: &FileLock ) -> Result<Option<IndexKrate>, Error>
Attempts to read the specified crate’s index metadata
An attempt is first made to read the cache entry for the crate, and falls back to reading the metadata from the git blob it is stored in
This method does no network I/O
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>
Attempts to read the locally cached crate information
Note this method has improvements over using GitIndex::cached_krate
.
In older versions of cargo, only the head commit hash is used as the version for cached crates, which means a fetch invalidates all cached crates, even if they have not been modified in any commits since the previous fetch.
This method does the same thing as cargo, which is to allow either
the head commit oid or the blob oid as a version, which is more
granular and means the cached crate can remain valid as long as it is
not updated in a subsequent fetch. GitIndex::cached_krate
cannot take
advantage of that though as it does not have access to git and thus
cannot know the blob id.
sourcepub fn fetch(&mut self, lock: &FileLock) -> Result<(), Error>
pub fn fetch(&mut self, lock: &FileLock) -> Result<(), Error>
Performs a fetch from the remote index repository.
This method performs network I/O.
sourcepub fn fetch_with_options<P>(
&mut self,
progress: P,
should_interrupt: &AtomicBool,
_lock: &FileLock
) -> Result<(), Error>where
P: NestedProgress,
P::SubProgress: 'static,
pub fn fetch_with_options<P>(
&mut self,
progress: P,
should_interrupt: &AtomicBool,
_lock: &FileLock
) -> Result<(), Error>where
P: NestedProgress,
P::SubProgress: 'static,
Same as Self::fetch
but allows specifying a progress implementation
and allows interruption of the network operations
Trait Implementations§
source§impl From<RemoteGitIndex> for ComboIndex
Available on crate feature sparse
only.
impl From<RemoteGitIndex> for ComboIndex
sparse
only.