Struct font_types::MajorMinor
source · #[repr(C)]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 for MajorMinor
impl Compatible 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 Default for MajorMinor
impl Default for MajorMinor
source§fn default() -> MajorMinor
fn default() -> MajorMinor
Returns the “default value” for a type. Read more
source§impl Display for MajorMinor
impl Display for MajorMinor
source§impl Hash for MajorMinor
impl Hash for MajorMinor
source§impl Ord for MajorMinor
impl Ord for MajorMinor
source§fn cmp(&self, other: &MajorMinor) -> Ordering
fn cmp(&self, other: &MajorMinor) -> Ordering
1.21.0 · 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 MajorMinor
impl PartialEq for MajorMinor
source§impl PartialOrd for MajorMinor
impl PartialOrd for MajorMinor
source§impl Scalar for MajorMinor
impl Scalar for MajorMinor
impl AnyBitPattern for MajorMinor
impl Copy for MajorMinor
impl Eq for MajorMinor
impl StructuralPartialEq for MajorMinor
Auto Trait Implementations§
impl Freeze for MajorMinor
impl RefUnwindSafe for MajorMinor
impl Send for MajorMinor
impl Sync for MajorMinor
impl Unpin for MajorMinor
impl UnwindSafe for MajorMinor
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
source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
source§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> FixedSize for Twhere
T: Scalar,
impl<T> FixedSize for Twhere
T: Scalar,
source§const RAW_BYTE_LEN: usize = const RAW_BYTE_LEN: usize = std::mem::size_of::<T::Raw>();
const RAW_BYTE_LEN: usize = const RAW_BYTE_LEN: usize = std::mem::size_of::<T::Raw>();
The raw size of this type, in bytes. Read more