pub struct WSLVersion(/* private fields */);Expand description
Represents a WSL version number.
This struct wraps the WSLVersion from the WSL Plugin API and provides
safe, idiomatic Rust access to its fields.
§Example
use wslplugins_rs::WSLVersion;
let version = WSLVersion::new(2, 0, 0);
assert_eq!(version.major(), 2);
assert_eq!(version.minor(), 0);
assert_eq!(version.revision(), 0);Implementations§
Source§impl WSLVersion
impl WSLVersion
Sourcepub const fn set_revision(&mut self, revision: u32)
pub const fn set_revision(&mut self, revision: u32)
Set the revision version number.
Sourcepub const fn is_at_least(&self, required_version: Self) -> bool
pub const fn is_at_least(&self, required_version: Self) -> bool
Returns true when this version is greater than or equal to required_version.
Sourcepub const fn supports(&self, capability: WSLVersionCapability) -> bool
pub const fn supports(&self, capability: WSLVersionCapability) -> bool
Returns true when this version supports the requested capability.
Sourcepub fn capabilities(&self) -> impl Iterator<Item = WSLVersionCapability> + '_
pub fn capabilities(&self) -> impl Iterator<Item = WSLVersionCapability> + '_
Iterates over every capability supported by this version, ordered by required version.
Trait Implementations§
Source§impl AsRef<WSLVersion> for WSLVersion
impl AsRef<WSLVersion> for WSLVersion
Source§fn as_ref(&self) -> &WSLVersion
fn as_ref(&self) -> &WSLVersion
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl AsRef<WSLVersion> for WSLVersion
impl AsRef<WSLVersion> for WSLVersion
Source§fn as_ref(&self) -> &WSLVersion
fn as_ref(&self) -> &WSLVersion
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Clone for WSLVersion
impl Clone for WSLVersion
Source§fn clone(&self) -> WSLVersion
fn clone(&self) -> WSLVersion
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for WSLVersion
Source§impl Debug for WSLVersion
impl Debug for WSLVersion
Source§impl<'de> Deserialize<'de> for WSLVersion
Available on crate feature serde only.
impl<'de> Deserialize<'de> for WSLVersion
Available on crate feature
serde only.Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for WSLVersion
impl Display for WSLVersion
impl Eq for WSLVersion
Source§impl From<WSLVersion> for RequirementDefinition
impl From<WSLVersion> for RequirementDefinition
Source§fn from(value: WSLVersion) -> Self
fn from(value: WSLVersion) -> Self
Converts to this type from the input type.
Source§impl From<WSLVersion> for Version
Available on crate feature semver only.
impl From<WSLVersion> for Version
Available on crate feature
semver only.Source§fn from(value: WSLVersion) -> Self
fn from(value: WSLVersion) -> Self
Converts to this type from the input type.
Source§impl From<WSLVersion> for WSLVersion
impl From<WSLVersion> for WSLVersion
Source§fn from(value: WSLVersion) -> Self
fn from(value: WSLVersion) -> Self
Converts to this type from the input type.
Source§impl From<WSLVersion> for WSLVersion
impl From<WSLVersion> for WSLVersion
Source§fn from(value: WSLVersion) -> Self
fn from(value: WSLVersion) -> Self
Converts to this type from the input type.
Source§impl FromStr for WSLVersion
impl FromStr for WSLVersion
Source§impl Hash for WSLVersion
impl Hash for WSLVersion
Source§impl Ord for WSLVersion
impl Ord for WSLVersion
Source§fn cmp(&self, other: &WSLVersion) -> Ordering
fn cmp(&self, other: &WSLVersion) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for WSLVersion
impl PartialEq for WSLVersion
Source§fn eq(&self, other: &WSLVersion) -> bool
fn eq(&self, other: &WSLVersion) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for WSLVersion
impl PartialOrd for WSLVersion
Source§impl Serialize for WSLVersion
Available on crate feature serde only.
impl Serialize for WSLVersion
Available on crate feature
serde only.impl StructuralPartialEq for WSLVersion
Auto Trait Implementations§
impl Freeze for WSLVersion
impl RefUnwindSafe for WSLVersion
impl Send for WSLVersion
impl Sync for WSLVersion
impl Unpin for WSLVersion
impl UnsafeUnpin for WSLVersion
impl UnwindSafe for WSLVersion
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more