Crate cargo_edit

Source
Expand description

Show and Edit Cargo’s Manifest Files

§Semver Compatibility

cargo-edit’s versioning tracks compatibility for the binaries, not the API. We upload to crates.io to distribute the binary. If using this as a library, be sure to pin the version with a = version requirement operator. Note though that our goal is for cargo-edit to go away as we move things into cargo.

Structs§

AnyIndexCache
CliError
The CLI error is the error type used at Cargo’s CLI-layer.
CrateSpec
User-specified crate
Dependency
A dependency handled by Cargo
IndexCache
LocalIndex
LocalManifest
A Cargo manifest that is available locally.
Manifest
A Cargo manifest
PathSource
Dependency from a local path
RegistrySource
Dependency from a registry
RemoteIndex
RustVersion
Simplified represetation of package.rust-version

Enums§

AnyIndex
CertsSource
Color
The set of available colors for the terminal foreground/background.
ColorChoice
ColorChoice represents the color preferences of an end user.
Source
Primary location of a dependency

Traits§

Context
Provides the context method for Result.
VersionExt
Additional version functionality

Functions§

colorize_stderr
Whether to color logged output
find
If a manifest is specified, return that one, otherise perform a manifest search starting from the current directory. If a manifest is specified, return that one. If a path is specified, perform a manifest search starting from there. If nothing is specified, start searching from the current directory (cwd).
get_compatible_dependency
Find the highest version compatible with a version req
get_dep_version
Get a dependency’s version from its entry in the dependency table
get_latest_dependency
Query latest version from a registry index
manifest_from_pkgid
Takes a pkgid and attempts to find the path to it’s Cargo.toml, using cargo’s metadata
registry_url
Find the URL of a registry
set_dep_version
Set a dependency’s version in its entry in the dependency table
shell_note
Print a styled warning message.
shell_print
Print a message with a colored title in the style of Cargo shell messages.
shell_status
Print a styled action message.
shell_warn
Print a styled warning message.
shell_write_stderr
Print a part of a line with formatting
shell_write_stdout
Print a part of a line with formatting
upgrade_requirement
Upgrade an existing requirement to a new version

Type Aliases§

CargoResult
Common result type
CliResult
CLI-specific result
Error
Common error type