pub struct UnityVersion {
pub major: u16,
pub minor: u16,
pub build: u16,
pub version_type: UnityVersionType,
pub type_number: u8,
pub type_str: Option<String>,
}Expand description
Unity version representation
Fields§
§major: u16§minor: u16§build: u16§version_type: UnityVersionType§type_number: u8§type_str: Option<String>Implementations§
Source§impl UnityVersion
impl UnityVersion
Sourcepub fn new(
major: u16,
minor: u16,
build: u16,
version_type: UnityVersionType,
type_number: u8,
) -> Self
pub fn new( major: u16, minor: u16, build: u16, version_type: UnityVersionType, type_number: u8, ) -> Self
Create a new Unity version
Sourcepub fn parse_version(version: &str) -> Result<Self>
pub fn parse_version(version: &str) -> Result<Self>
Parse Unity version from string Supports formats like: “2020.3.12f1”, “5.6.0”, “2018.1.1b2”
Sourcepub fn is_gte(&self, other: &UnityVersion) -> bool
pub fn is_gte(&self, other: &UnityVersion) -> bool
Check if this version is greater than or equal to another
Sourcepub fn is_lt(&self, other: &UnityVersion) -> bool
pub fn is_lt(&self, other: &UnityVersion) -> bool
Check if this version is less than another
Sourcepub fn supports_feature(&self, feature: UnityFeature) -> bool
pub fn supports_feature(&self, feature: UnityFeature) -> bool
Check if this version supports a specific feature
Sourcepub fn get_alignment(&self) -> usize
pub fn get_alignment(&self) -> usize
Get the appropriate byte alignment for this version
Sourcepub fn uses_big_endian(&self) -> bool
pub fn uses_big_endian(&self) -> bool
Check if this version uses big endian by default
Sourcepub fn get_serialized_file_format_version(&self) -> u32
pub fn get_serialized_file_format_version(&self) -> u32
Get the serialized file format version for this Unity version
Trait Implementations§
Source§impl Clone for UnityVersion
impl Clone for UnityVersion
Source§fn clone(&self) -> UnityVersion
fn clone(&self) -> UnityVersion
Returns a duplicate 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 UnityVersion
impl Debug for UnityVersion
Source§impl Default for UnityVersion
impl Default for UnityVersion
Source§impl<'de> Deserialize<'de> for UnityVersion
impl<'de> Deserialize<'de> for UnityVersion
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for UnityVersion
impl Display for UnityVersion
Source§impl Ord for UnityVersion
impl Ord for UnityVersion
Source§impl PartialEq for UnityVersion
impl PartialEq for UnityVersion
Source§impl PartialOrd for UnityVersion
impl PartialOrd for UnityVersion
Source§impl Serialize for UnityVersion
impl Serialize for UnityVersion
impl Eq for UnityVersion
impl StructuralPartialEq for UnityVersion
Auto Trait Implementations§
impl Freeze for UnityVersion
impl RefUnwindSafe for UnityVersion
impl Send for UnityVersion
impl Sync for UnityVersion
impl Unpin for UnityVersion
impl UnwindSafe for UnityVersion
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.