Struct janetrs::util::JanetVersion
source · pub struct JanetVersion { /* private fields */ }
Expand description
Janet version representation.
It has convenient comparison operators implementations with triples (u32, u32, u32)
,
arrays [u32; 3]
and str
.
Implementations§
source§impl JanetVersion
impl JanetVersion
sourcepub const fn current() -> JanetVersion
pub const fn current() -> JanetVersion
Get the current Janet version.
sourcepub const fn custom(major: u32, minor: u32, patch: u32) -> JanetVersion
pub const fn custom(major: u32, minor: u32, patch: u32) -> JanetVersion
Create a custom JanetVersion
given the version number.
Mostly used to check if current version match a requirement for your code.
Trait Implementations§
source§impl Clone for JanetVersion
impl Clone for JanetVersion
source§fn clone(&self) -> JanetVersion
fn clone(&self) -> JanetVersion
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 Debug for JanetVersion
impl Debug for JanetVersion
source§impl Display for JanetVersion
impl Display for JanetVersion
source§impl Hash for JanetVersion
impl Hash for JanetVersion
source§impl Ord for JanetVersion
impl Ord for JanetVersion
source§fn cmp(&self, other: &JanetVersion) -> Ordering
fn cmp(&self, other: &JanetVersion) -> 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<&str> for JanetVersion
impl PartialEq<&str> for JanetVersion
source§impl PartialEq<[u32; 3]> for JanetVersion
impl PartialEq<[u32; 3]> for JanetVersion
source§impl PartialEq<(u32, u32, u32)> for JanetVersion
impl PartialEq<(u32, u32, u32)> for JanetVersion
source§impl PartialEq for JanetVersion
impl PartialEq for JanetVersion
source§fn eq(&self, other: &JanetVersion) -> bool
fn eq(&self, other: &JanetVersion) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<&str> for JanetVersion
impl PartialOrd<&str> for JanetVersion
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl PartialOrd<[u32; 3]> for JanetVersion
impl PartialOrd<[u32; 3]> for JanetVersion
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl PartialOrd<(u32, u32, u32)> for JanetVersion
impl PartialOrd<(u32, u32, u32)> for JanetVersion
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl PartialOrd for JanetVersion
impl PartialOrd for JanetVersion
source§fn partial_cmp(&self, other: &JanetVersion) -> Option<Ordering>
fn partial_cmp(&self, other: &JanetVersion) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for JanetVersion
impl Eq for JanetVersion
impl StructuralPartialEq for JanetVersion
Auto Trait Implementations§
impl Freeze for JanetVersion
impl RefUnwindSafe for JanetVersion
impl Send for JanetVersion
impl Sync for JanetVersion
impl Unpin for JanetVersion
impl UnwindSafe for JanetVersion
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