pub struct AwpVersion {
pub major: u32,
pub minor: u32,
}Expand description
AWP protocol version with major and minor components.
Versions are compatible when their major versions match.
§Example
use awp_types::AwpVersion;
let v1 = AwpVersion { major: 1, minor: 0 };
let v1_1 = AwpVersion { major: 1, minor: 1 };
assert!(v1.is_compatible(&v1_1));Fields§
§major: u32§minor: u32Implementations§
Source§impl AwpVersion
impl AwpVersion
Sourcepub fn is_compatible(&self, other: &AwpVersion) -> bool
pub fn is_compatible(&self, other: &AwpVersion) -> bool
Returns true if this version is compatible with other.
Compatibility is determined by matching major versions.
Trait Implementations§
Source§impl Clone for AwpVersion
impl Clone for AwpVersion
Source§fn clone(&self) -> AwpVersion
fn clone(&self) -> AwpVersion
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 moreSource§impl Debug for AwpVersion
impl Debug for AwpVersion
Source§impl<'de> Deserialize<'de> for AwpVersion
impl<'de> Deserialize<'de> for AwpVersion
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 AwpVersion
impl Display for AwpVersion
Source§impl FromStr for AwpVersion
impl FromStr for AwpVersion
Source§impl Hash for AwpVersion
impl Hash for AwpVersion
Source§impl PartialEq for AwpVersion
impl PartialEq for AwpVersion
Source§fn eq(&self, other: &AwpVersion) -> bool
fn eq(&self, other: &AwpVersion) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for AwpVersion
impl Serialize for AwpVersion
impl Copy for AwpVersion
impl Eq for AwpVersion
impl StructuralPartialEq for AwpVersion
Auto Trait Implementations§
impl Freeze for AwpVersion
impl RefUnwindSafe for AwpVersion
impl Send for AwpVersion
impl Sync for AwpVersion
impl Unpin for AwpVersion
impl UnsafeUnpin for AwpVersion
impl UnwindSafe for AwpVersion
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