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.source§fn from(index: RemoteGitIndex) -> Self
fn from(index: RemoteGitIndex) -> Self
Auto Trait Implementations§
impl !Freeze for RemoteGitIndex
impl !RefUnwindSafe for RemoteGitIndex
impl !Send for RemoteGitIndex
impl !Sync for RemoteGitIndex
impl Unpin for RemoteGitIndex
impl !UnwindSafe for RemoteGitIndex
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
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>
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>
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