tame_index::index

Struct RemoteGitIndex

Source
pub struct RemoteGitIndex { /* private fields */ }
Available on crate feature __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

Source

pub fn new(index: GitIndex, lock: &FileLock) -> Result<Self, Error>

Creates a new Self that can access and write local cache entries, and contact the remote index to retrieve the latest index information

Note that if a repository does not exist at the local disk path of the provided GitIndex, a full clone will be performed.

Source

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

Source

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.

Source

pub fn local(&self) -> &GitIndex

Gets the local index

Source

pub fn index_config(&self) -> Result<IndexConfig, Error>

Get the configuration of the index.

See the cargo docs

Source

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

Source

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.

Source

pub fn fetch(&mut self, lock: &FileLock) -> Result<(), Error>

Performs a fetch from the remote index repository.

This method performs network I/O.

Source

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.
Source§

fn from(index: RemoteGitIndex) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize = _

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T