pub struct RemoteRegistry<'cfg> {
index_path: Filesystem,
cache_path: Filesystem,
source_id: SourceId,
index_git_ref: GitReference,
config: &'cfg Config,
tree: RefCell<Option<Tree<'static>>>,
repo: LazyCell<Repository>,
head: Cell<Option<Oid>>,
current_sha: Cell<Option<InternedString>>,
needs_update: bool,
}
Expand description
A remote registry is a registry that lives at a remote URL (such as
crates.io). The git index is cloned locally, and .crate
files are
downloaded as needed and cached locally.
Fields§
§index_path: Filesystem
§cache_path: Filesystem
Path to the cache of .crate
files ($CARGO_HOME/registry/path/$REG-HASH
).
source_id: SourceId
§index_git_ref: GitReference
§config: &'cfg Config
§tree: RefCell<Option<Tree<'static>>>
§repo: LazyCell<Repository>
§head: Cell<Option<Oid>>
§current_sha: Cell<Option<InternedString>>
§needs_update: bool
Implementations§
source§impl<'cfg> RemoteRegistry<'cfg>
impl<'cfg> RemoteRegistry<'cfg>
pub fn new(
source_id: SourceId,
config: &'cfg Config,
name: &str
) -> RemoteRegistry<'cfg>
fn repo(&self) -> CargoResult<&Repository>
fn head(&self) -> CargoResult<Oid>
fn tree(&self) -> CargoResult<Ref<'_, Tree<'_>>>
fn current_version(&self) -> Option<InternedString>
fn is_updated(&self) -> bool
fn mark_updated(&self)
Trait Implementations§
source§impl<'cfg> Drop for RemoteRegistry<'cfg>
impl<'cfg> Drop for RemoteRegistry<'cfg>
source§impl<'cfg> RegistryData for RemoteRegistry<'cfg>
impl<'cfg> RegistryData for RemoteRegistry<'cfg>
source§fn index_path(&self) -> &Filesystem
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
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>>
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>>>
fn config(&mut self) -> Poll<CargoResult<Option<RegistryConfig>>>
Loads the
config.json
file and returns it. Read moresource§fn block_until_ready(&mut self) -> CargoResult<()>
fn block_until_ready(&mut self) -> CargoResult<()>
Block until all outstanding Poll::Pending requests are Poll::Ready.
source§fn invalidate_cache(&mut self)
fn invalidate_cache(&mut self)
Invalidates locally cached data.
source§fn is_updated(&self) -> bool
fn is_updated(&self) -> bool
Is the local cached data up-to-date?
source§fn download(&mut self, pkg: PackageId, checksum: &str) -> CargoResult<MaybeLock>
fn download(&mut self, pkg: PackageId, checksum: &str) -> CargoResult<MaybeLock>
Prepare to start downloading a
.crate
file. Read moresource§fn finish_download(
&mut self,
pkg: PackageId,
checksum: &str,
data: &[u8]
) -> CargoResult<File>
fn finish_download(
&mut self,
pkg: PackageId,
checksum: &str,
data: &[u8]
) -> CargoResult<File>
Finish a download by saving a
.crate
file to disk. Read moresource§fn is_crate_downloaded(&self, pkg: PackageId) -> bool
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 RemoteRegistry<'cfg>
impl<'cfg> !Send for RemoteRegistry<'cfg>
impl<'cfg> !Sync for RemoteRegistry<'cfg>
impl<'cfg> Unpin for RemoteRegistry<'cfg>
impl<'cfg> !UnwindSafe for RemoteRegistry<'cfg>
Blanket Implementations§
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: 176 bytes