Struct os_info::Version [] [src]

pub struct Version { /* fields omitted */ }

Operating system version including version number and optional edition.

Methods

impl Version
[src]

[src]

Constructs a new Version instance with unknown version and None edition.

Examples

use os_info::{Version, VersionType};

let version = Version::unknown();
assert_eq!(VersionType::Unknown, *version.version());
assert_eq!(None, version.edition());

[src]

Constructs a new Version instance with semantic version and given edition.

Examples

use os_info::{Version, VersionType};

let version = Version::semantic(0, 1, 2, None);
assert_eq!(VersionType::Semantic(0, 1, 2), *version.version());
assert_eq!(None, version.edition());

[src]

Construct a new Version instance with "custom" (non semantic) version and given edition.

Examples

use os_info::{Version, VersionType};

let ver = "version".to_string();
let edition = "edition".to_string();
let version = Version::custom(ver.clone(), Some(edition.clone()));
assert_eq!(VersionType::Custom(ver), *version.version());
assert_eq!(Some(edition.as_ref()), version.edition());

[src]

Returns operating system version. See VersionType for details.

Examples

use os_info::{Version, VersionType};

let version = Version::unknown();
assert_eq!(VersionType::Unknown, *version.version());

[src]

Returns optional (can be absent) operation system edition.

Examples

use os_info::Version;

let version = Version::unknown();
assert_eq!(None, version.edition());

Trait Implementations

impl Debug for Version
[src]

[src]

Formats the value using the given formatter. Read more

impl Clone for Version
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialEq for Version
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Eq for Version
[src]

impl PartialOrd for Version
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

[src]

This method tests less than (for self and other) and is used by the < operator. Read more

[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Ord for Version
[src]

[src]

This method returns an Ordering between self and other. Read more

1.21.0
[src]

Compares and returns the maximum of two values. Read more

1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl Hash for Version
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Display for Version
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Version

impl Sync for Version