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,
) -> UnityVersion
pub fn new( major: u16, minor: u16, build: u16, version_type: UnityVersionType, type_number: u8, ) -> UnityVersion
Create a new Unity version
Sourcepub fn parse_version(version: &str) -> Result<UnityVersion, BinaryError>
pub fn parse_version(version: &str) -> Result<UnityVersion, BinaryError>
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§fn default() -> UnityVersion
fn default() -> UnityVersion
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for UnityVersion
impl<'de> Deserialize<'de> for UnityVersion
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<UnityVersion, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<UnityVersion, <__D as Deserializer<'de>>::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§fn cmp(&self, other: &UnityVersion) -> Ordering
fn cmp(&self, other: &UnityVersion) -> 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 UnityVersion
impl PartialEq for UnityVersion
Source§impl PartialOrd for UnityVersion
impl PartialOrd for UnityVersion
Source§impl Serialize for UnityVersion
impl Serialize for UnityVersion
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().