Module ops

Module ops 

Source
Expand description

Main functions doing actual work.

Use installed_registry_packages() to list the installed packages, then use intersect_packages() to confirm which ones should be updated, poll the packages’ latest versions by calling RegistryPackage::pull_version() on them, continue with doing whatever you wish.

Structs§

CargoConfig
cargo configuration, as obtained from .cargo/config[.toml]
CargoConfigEnvironmentNormalisedString
https://doc.rust-lang.org/cargo/reference/config.html#environment-variables
EnvironmentOverride
Wrapper that serialises None as a boolean.
GitRepoPackage
A representation of a package a remote git repository.
HttpCargoConfig
PackageConfig
Compilation configuration for one crate.
RegistryPackage
A representation of a package from the main crates.io repository.
SparseRegistryAuthProviderBundle
SparseRegistryConfig
https://github.com/nabijaczleweli/cargo-update/issues/300

Enums§

ConfigOperation
A single operation to be executed upon configuration of a package.
PackageFilterElement
One of elements with which to filter required packages.
Registry
Either an open git repository with a git registry, or a map of (package, sorted versions), populated by update_index()
RegistryTree
A git tree corresponding to the latest revision of a git registry.
SparseRegistryAuthProvider
https://doc.rust-lang.org/cargo/reference/registry-authentication.html

Functions§

assert_index_path
Get the location of the registry index corresponding ot the given URL; if not present – make it and its parents.
auth_providers
Collect everything needed to get an authentication token for the given registry.
cargo_hash
Stolen from and equivalent to short_hash() from https://github.com/rust-lang/cargo/blob/74f2b400d2be43da798f99f94957d359bc223988/src/cargo/util/hex.rs
crate_versions
Parse the raw crate descriptor from the repository into a collection of Semvers.
crates_file_in
Follow install.root in the config or config.toml file in the cargo directory specified.
find_git_db_repo
Find the bare git repository in the specified directory for the specified crate
find_package_data
Find package data in the specified cargo git index tree.
find_proxy
Check if there’s a proxy specified to be used.
get_index_url
Get the URL to update index from, whether it’s “sparse”, and the cargo name for it from the config file parallel to the specified crates file
installed_git_repo_packages
List the installed packages at the specified location that originate from a remote git repository.
installed_registry_packages
List the installed packages at the specified location that originate from the a cargo registry.
intersect_packages
Filter out the installed packages not specified to be updated and add the packages you specify to install, if they aren’t already installed via git.
open_index_repository
Opens or initialises a git repository at registry, or returns a blank sparse registry.
parse_registry_head
Get FETCH_HEAD or origin/HEAD, then unwrap it to the tree it points to.
registry_shortname
The short filesystem name for the repository, as used by cargo
split_package_path
Split and lower-case cargo-update into [ca, rg, cargo-update], jot into [3, j, jot], &c.
update_index
Update the specified index repository from the specified URL.