Struct yy_typings::ResourceVersion
source · [−]Expand description
A struct, which implements Serialize and Deserialize, for Gms2 version strings of the form “1.0” or “4.2”. Basically, a bad SemVer.
Fields
major: usize
The major version of the Resource. Defaults to 1
minor: usize
The minor version of the Resource. Defaults to 0
Implementations
sourceimpl ResourceVersion
impl ResourceVersion
sourcepub fn new(major: usize, minor: usize) -> ResourceVersion
pub fn new(major: usize, minor: usize) -> ResourceVersion
Creates a new default ResourceVersion with the major and minor version
given. The default implementation runs this with 1 and 0.
ResourceVersion::blank
is a shorthand for ResourceVersion::new(0, 0)
.
let default = ResourceVersion::new(1, 0);
assert_eq!(default, ResourceVersion { major: 1, minor: 0 });
sourcepub fn blank() -> ResourceVersion
pub fn blank() -> ResourceVersion
Creates a new blank ResourceVersion with the major and minor version set to 0.0. This is not the default.
let blank = ResourceVersion::blank();
assert_eq!(default, ResourceVersion { major: 0, minor: 0 });
Trait Implementations
sourceimpl Clone for ResourceVersion
impl Clone for ResourceVersion
sourcefn clone(&self) -> ResourceVersion
fn clone(&self) -> ResourceVersion
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ResourceVersion
impl Debug for ResourceVersion
sourceimpl Default for ResourceVersion
impl Default for ResourceVersion
sourceimpl<'de> Deserialize<'de> for ResourceVersion
impl<'de> Deserialize<'de> for ResourceVersion
sourcefn deserialize<D>(deserializer: D) -> Result<ResourceVersion, D::Error> where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<ResourceVersion, D::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Display for ResourceVersion
impl Display for ResourceVersion
sourceimpl FromStr for ResourceVersion
impl FromStr for ResourceVersion
sourceimpl Hash for ResourceVersion
impl Hash for ResourceVersion
sourceimpl Ord for ResourceVersion
impl Ord for ResourceVersion
sourceimpl PartialEq<ResourceVersion> for ResourceVersion
impl PartialEq<ResourceVersion> for ResourceVersion
sourcefn eq(&self, other: &ResourceVersion) -> bool
fn eq(&self, other: &ResourceVersion) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ResourceVersion) -> bool
fn ne(&self, other: &ResourceVersion) -> bool
This method tests for !=
.
sourceimpl PartialOrd<ResourceVersion> for ResourceVersion
impl PartialOrd<ResourceVersion> for ResourceVersion
sourcefn partial_cmp(&self, other: &ResourceVersion) -> Option<Ordering>
fn partial_cmp(&self, other: &ResourceVersion) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl Serialize for ResourceVersion
impl Serialize for ResourceVersion
impl Copy for ResourceVersion
impl Eq for ResourceVersion
impl StructuralEq for ResourceVersion
impl StructuralPartialEq for ResourceVersion
Auto Trait Implementations
impl RefUnwindSafe for ResourceVersion
impl Send for ResourceVersion
impl Sync for ResourceVersion
impl Unpin for ResourceVersion
impl UnwindSafe for ResourceVersion
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more