pub enum ResolveVersion {
V1,
V2,
}Expand description
A version to indicate how a Cargo.lock should be serialized. Currently
V2 is the default when creating a new lockfile. If a V1 lockfile already
exists, it will stay as V1.
It’s theorized that we can add more here over time to track larger changes
to the Cargo.lock format, but we’ve yet to see how that strategy pans out.
Variants§
V1
Historical baseline for when this abstraction was added.
V2
A more compact format, more amenable to avoiding source-control merge
conflicts. The dependencies arrays are compressed and checksums are
listed inline. Introduced in 2019 in version 1.38. New lockfiles use
V2 by default starting in 1.41.
Implementations§
Source§impl ResolveVersion
impl ResolveVersion
Sourcepub fn default_for_new_lockfiles() -> ResolveVersion
pub fn default_for_new_lockfiles() -> ResolveVersion
The default way to encode new Cargo.lock files.
It’s important that if a new version of ResolveVersion is added that
this is not updated until at least the support for the version is in
the stable release of Rust. It’s ok for this to be newer than
default_for_old_lockfiles below.
Sourcepub fn default_for_old_lockfiles() -> ResolveVersion
pub fn default_for_old_lockfiles() -> ResolveVersion
The default way to encode old preexisting Cargo.lock files. This is
often trailing the new lockfiles one above to give older projects a
longer time to catch up.
It’s important that this trails behind default_for_new_lockfiles for
quite some time. This gives projects a quite large window to update in
where we don’t force updates, so if projects span many versions of Cargo
all those versions of Cargo will have support for a new version of the
lock file.
Trait Implementations§
Source§impl Clone for ResolveVersion
impl Clone for ResolveVersion
Source§fn clone(&self) -> ResolveVersion
fn clone(&self) -> ResolveVersion
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more