Struct font_types::MajorMinor
source · pub struct MajorMinor {
pub major: u16,
pub minor: u16,
}
Expand description
A type representing a major, minor version pair.
This is not part of the spec, but versions in the spec are frequently
represented as a major_version
, minor_version
pair. This type encodes
those as a single type, which is useful for some of the generated code that
parses out a version.
Fields§
§major: u16
The major version number
minor: u16
The minor version number
Implementations§
source§impl MajorMinor
impl MajorMinor
sourcepub const VERSION_1_0: MajorMinor = _
pub const VERSION_1_0: MajorMinor = _
Version 1.0
sourcepub const VERSION_1_1: MajorMinor = _
pub const VERSION_1_1: MajorMinor = _
Version 1.1
sourcepub const VERSION_1_2: MajorMinor = _
pub const VERSION_1_2: MajorMinor = _
Version 1.2
sourcepub const VERSION_1_3: MajorMinor = _
pub const VERSION_1_3: MajorMinor = _
Version 1.3
sourcepub const VERSION_2_0: MajorMinor = _
pub const VERSION_2_0: MajorMinor = _
Version 2.0
sourcepub const fn new(major: u16, minor: u16) -> Self
pub const fn new(major: u16, minor: u16) -> Self
Create a new version with major and minor parts.
sourcepub const fn to_be_bytes(self) -> [u8; 4]
pub const fn to_be_bytes(self) -> [u8; 4]
The representation of this version as a big-endian byte array.
Trait Implementations§
source§impl Clone for MajorMinor
impl Clone for MajorMinor
source§fn clone(&self) -> MajorMinor
fn clone(&self) -> MajorMinor
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Compatible<(u16, u16)> for MajorMinor
impl Compatible<(u16, u16)> for MajorMinor
source§impl Compatible<MajorMinor> for MajorMinor
impl Compatible<MajorMinor> for MajorMinor
source§fn compatible(&self, other: Self) -> bool
fn compatible(&self, other: Self) -> bool
source§impl Debug for MajorMinor
impl Debug for MajorMinor
source§impl Display for MajorMinor
impl Display for MajorMinor
source§impl PartialEq<MajorMinor> for MajorMinor
impl PartialEq<MajorMinor> for MajorMinor
source§fn eq(&self, other: &MajorMinor) -> bool
fn eq(&self, other: &MajorMinor) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.