# Struct cargo::sources::registry::local::LocalRegistry

source ·

    pub struct LocalRegistry<'cfg> {
        index_path: Filesystem,
        root: Filesystem,
        src_path: Filesystem,
        config: &'cfg Config,
        updated: bool,
        quiet: bool,
    }

Expand description

A local registry is a registry that lives on the filesystem as a set of `.crate` files with an `index` directory in the same format as a remote registry.

## Fields§

§`index_path: Filesystem`§`root: Filesystem`§`src_path: Filesystem`§`config: &'cfg Config`§`updated: bool`§`quiet: bool`

## Implementations§

source§

### impl<'cfg> LocalRegistry<'cfg>

source

#### pub fn new(root: &Path, config: &'cfg Config, name: &str) -> LocalRegistry<'cfg>

## Trait Implementations§

source§

### impl<'cfg> RegistryData for LocalRegistry<'cfg>

source§

#### fn prepare(&self) -> CargoResult<()>

Performs initialization for the registry. Read more
source§

#### fn index_path(&self) -> &Filesystem

Returns the path to the index. Read more
source§

#### fn assert_index_locked<'a>(&self, path: &'a Filesystem) -> &'a Path

Validates that the global package cache lock is held. Read more
source§

#### fn load( &mut self, root: &Path, path: &Path, _index_version: Option<&str> ) -> Poll<CargoResult<LoadResponse>>

Loads the JSON for a specific named package from the index. Read more
source§

#### fn config(&mut self) -> Poll<CargoResult<Option<RegistryConfig>>>

Loads the `config.json` file and returns it. Read more
source§

#### fn block_until_ready(&mut self) -> CargoResult<()>

Block until all outstanding Poll::Pending requests are Poll::Ready.
source§

#### fn invalidate_cache(&mut self)

Invalidates locally cached data.
source§

#### fn set_quiet(&mut self, _quiet: bool)

If quiet, the source should not display any progress or status messages.
source§

#### fn is_updated(&self) -> bool

Is the local cached data up-to-date?
source§

#### fn download(&mut self, pkg: PackageId, checksum: &str) -> CargoResult<MaybeLock>

Prepare to start downloading a `.crate` file. Read more
source§

#### fn finish_download( &mut self, _pkg: PackageId, _checksum: &str, _data: &[u8] ) -> CargoResult<File>

Finish a download by saving a `.crate` file to disk. Read more
source§

#### fn is_crate_downloaded(&self, _pkg: PackageId) -> bool

Returns whether or not the `.crate` file is already downloaded.

## Auto Trait Implementations§

§

### impl<'cfg> !RefUnwindSafe for LocalRegistry<'cfg>

§

### impl<'cfg> !Send for LocalRegistry<'cfg>

§

### impl<'cfg> !Sync for LocalRegistry<'cfg>

§

### impl<'cfg> Unpin for LocalRegistry<'cfg>

§

### impl<'cfg> !UnwindSafe for LocalRegistry<'cfg>

## Blanket Implementations§

source§

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

source§

#### fn type_id(&self) -> TypeId

Gets the `TypeId` of `self`. Read more
source§

### impl<T> Borrow<T> for Twhere T: ?Sized,

source§

#### fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

### impl<T> BorrowMut<T> for Twhere 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, U> Into<U> for Twhere 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> Same<T> for T

§

#### type Output = T

Should always be `Self`
source§

### impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

#### 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 Twhere U: TryFrom<T>,

§

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

### impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

#### fn vzip(self) -> V

## Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain `repr(...)` attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.

Size:88 bytes