Struct alkahest::FixedIsize
source · #[repr(transparent)]pub struct FixedIsize(_);Expand description
Type used to represent isize in serialized form.
Number of bits is controlled by "fixed*" feature flags.
Default is "fixed32" - fixed sizes are 32-bit integers.
Implementations§
source§impl FixedIsize
impl FixedIsize
sourcepub fn truncate_unchecked(value: isize) -> Self
pub fn truncate_unchecked(value: isize) -> Self
Truncates isize to FixedIsizeType without checking.
sourcepub fn to_le_bytes(self) -> [u8; 4]
pub fn to_le_bytes(self) -> [u8; 4]
Converts to byte array in little endian.
sourcepub fn from_le_bytes(bytes: [u8; 4]) -> Result<Self, TryFromIntError>
pub fn from_le_bytes(bytes: [u8; 4]) -> Result<Self, TryFromIntError>
Converts from byte array in little endian.
Errors
Returns Err if the byte array does not represent a valid isize.
Trait Implementations§
source§impl Clone for FixedIsize
impl Clone for FixedIsize
source§fn clone(&self) -> FixedIsize
fn clone(&self) -> FixedIsize
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 FixedIsize
impl Debug for FixedIsize
source§impl Default for FixedIsize
impl Default for FixedIsize
source§fn default() -> FixedIsize
fn default() -> FixedIsize
Returns the “default value” for a type. Read more
source§impl Deserialize<'_, FixedIsize> for FixedIsize
impl Deserialize<'_, FixedIsize> for FixedIsize
source§fn deserialize(de: Deserializer<'_>) -> Result<Self, DeserializeError>
fn deserialize(de: Deserializer<'_>) -> Result<Self, DeserializeError>
Deserializes value provided deserializer.
Returns deserialized value and the number of bytes consumed from
the and of input. Read more
source§fn deserialize_in_place(
&mut self,
de: Deserializer<'_>
) -> Result<(), DeserializeError>
fn deserialize_in_place( &mut self, de: Deserializer<'_> ) -> Result<(), DeserializeError>
Deserializes value in-place provided deserializer.
Overwrites
self with data from the input. Read moresource§impl Deserialize<'_, FixedIsize> for isize
impl Deserialize<'_, FixedIsize> for isize
source§fn deserialize(de: Deserializer<'_>) -> Result<Self, DeserializeError>
fn deserialize(de: Deserializer<'_>) -> Result<Self, DeserializeError>
Deserializes value provided deserializer.
Returns deserialized value and the number of bytes consumed from
the and of input. Read more
source§fn deserialize_in_place(
&mut self,
de: Deserializer<'_>
) -> Result<(), DeserializeError>
fn deserialize_in_place( &mut self, de: Deserializer<'_> ) -> Result<(), DeserializeError>
Deserializes value in-place provided deserializer.
Overwrites
self with data from the input. Read moresource§impl Formula for FixedIsize
impl Formula for FixedIsize
source§impl From<FixedIsize> for FixedIsizeType
impl From<FixedIsize> for FixedIsizeType
source§fn from(value: FixedIsize) -> Self
fn from(value: FixedIsize) -> Self
Converts to this type from the input type.
source§impl From<FixedIsize> for isize
impl From<FixedIsize> for isize
source§fn from(value: FixedIsize) -> Self
fn from(value: FixedIsize) -> Self
Converts to this type from the input type.
source§impl Hash for FixedIsize
impl Hash for FixedIsize
source§impl Ord for FixedIsize
impl Ord for FixedIsize
source§fn cmp(&self, other: &FixedIsize) -> Ordering
fn cmp(&self, other: &FixedIsize) -> 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<FixedIsize> for FixedIsize
impl PartialEq<FixedIsize> for FixedIsize
source§fn eq(&self, other: &FixedIsize) -> bool
fn eq(&self, other: &FixedIsize) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd<FixedIsize> for FixedIsize
impl PartialOrd<FixedIsize> for FixedIsize
source§fn partial_cmp(&self, other: &FixedIsize) -> Option<Ordering>
fn partial_cmp(&self, other: &FixedIsize) -> 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 moresource§impl Serialize<FixedIsize> for &FixedIsize
impl Serialize<FixedIsize> for &FixedIsize
source§impl Serialize<FixedIsize> for &isize
impl Serialize<FixedIsize> for &isize
source§impl Serialize<FixedIsize> for FixedIsize
impl Serialize<FixedIsize> for FixedIsize
source§impl Serialize<FixedIsize> for isize
impl Serialize<FixedIsize> for isize
source§impl TryFrom<i32> for FixedIsize
impl TryFrom<i32> for FixedIsize
§type Error = TryFromIntError
type Error = TryFromIntError
The type returned in the event of a conversion error.
source§fn try_from(value: FixedIsizeType) -> Result<Self, TryFromIntError>
fn try_from(value: FixedIsizeType) -> Result<Self, TryFromIntError>
Performs the conversion.
source§impl TryFrom<isize> for FixedIsize
impl TryFrom<isize> for FixedIsize
§type Error = TryFromIntError
type Error = TryFromIntError
The type returned in the event of a conversion error.