pub struct ListVersion {
pub major: u16,
pub minor: u16,
pub patch: u16,
}Expand description
A struct describing the version of a module in this crate.
List-containing modules in this crate have their own version, separate from the full crate version.
A module on a 0.x.y version is subject to ANY change during a crate minor release,
including removal of it entirely.
This system also exists so that you can use a breaking crate-level update, while knowing that you will not have to change any of your code, because the update only broke a specific list that you are not using.
Essentially, when using this crate, you should always use an exact version specifier =x.y.z,
and only update when you have checked the new ListVersion of the list(s) you are using.
The ListVersion of all of the lists is next to the module name in the README, and in module::VERSION.
See the SemVer specification for details on the meaning of “major”, “minor”, and “patch”.
Fields§
§major: u16The major version of a module.
When this is 0, all items in the module are considered “experimental”, and may be removed at any crate minor release. Otherwise, the biggest change to any module will cause that level of crate update.
minor: u16The minor version of a module.
patch: u16The patch version of a module.
Implementations§
Source§impl ListVersion
impl ListVersion
Sourcepub fn experimental(self) -> bool
pub fn experimental(self) -> bool
Returns whether this list is considered “experimental” or not.
An experimental list can have breaking changes in non-breaking crate releases.
Sourcepub fn compatible(self, other: ListVersion) -> bool
pub fn compatible(self, other: ListVersion) -> bool
Returns whether self could be used when other was the specified version.
§Examples
use linked_lists::ListVersion;
let version = ListVersion {
major: 1,
minor: 2,
patch: 3,
};
let expected = linked_lists::ListVersion {
major: 1,
minor: 0,
patch: 0
};
assert!(version.compatible(expected));Trait Implementations§
Source§impl Clone for ListVersion
impl Clone for ListVersion
Source§fn clone(&self) -> ListVersion
fn clone(&self) -> ListVersion
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more