Struct janetrs_version::JanetVersion [−][src]
Janet version representation.
It has convenient comparison operators implementations with triples (u32, u32, u32)
,
arrays [u32; 3]
and str
.
Implementations
impl JanetVersion
[src]
pub const fn current() -> Self
[src]
Get the current Janet version.
pub const fn custom(major: u32, minor: u32, patch: u32) -> Self
[src]
Create a custom JanetVersion
given the version number.
Mostly used to check if current version match a requirement for your code.
pub const fn major(&self) -> u32
[src]
Return the Janet major version.
pub const fn minor(&self) -> u32
[src]
Return the Janet minor version.
pub const fn patch(&self) -> u32
[src]
Return the Janet patch version.
Trait Implementations
impl Clone for JanetVersion
[src]
fn clone(&self) -> JanetVersion
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for JanetVersion
[src]
impl Debug for JanetVersion
[src]
impl Display for JanetVersion
[src]
impl Eq for JanetVersion
[src]
impl Hash for JanetVersion
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for JanetVersion
[src]
fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<&'_ str> for JanetVersion
[src]
impl PartialEq<[u32; 3]> for JanetVersion
[src]
fn eq(&self, [major, minor, patch]: &[u32; 3]) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<(u32, u32, u32)> for JanetVersion
[src]
fn eq(&self, (major, minor, patch): &(u32, u32, u32)) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<JanetVersion> for JanetVersion
[src]
fn eq(&self, other: &JanetVersion) -> bool
[src]
fn ne(&self, other: &JanetVersion) -> bool
[src]
impl PartialOrd<&'_ str> for JanetVersion
[src]
fn partial_cmp(&self, other: &&str) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<[u32; 3]> for JanetVersion
[src]
fn partial_cmp(&self, [major, minor, patch]: &[u32; 3]) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<(u32, u32, u32)> for JanetVersion
[src]
fn partial_cmp(
&self,
(major, minor, patch): &(u32, u32, u32)
) -> Option<Ordering>
[src]
&self,
(major, minor, patch): &(u32, u32, u32)
) -> Option<Ordering>
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<JanetVersion> for JanetVersion
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for JanetVersion
[src]
impl StructuralPartialEq for JanetVersion
[src]
Auto Trait Implementations
impl RefUnwindSafe for JanetVersion
impl Send for JanetVersion
impl Sync for JanetVersion
impl Unpin for JanetVersion
impl UnwindSafe for JanetVersion
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,