Enum ParamFieldType

Source
pub enum ParamFieldType {
Show 13 variants s8, u8 { bit_size: Option<u8>, }, s16, u16 { bit_size: Option<u8>, }, s32, u32 { bit_size: Option<u8>, }, b32, f32, a32, f64, fixstr { length: usize, }, fixstrW { length: usize, }, dummy8 { length: Option<DummyType>, },
}
Expand description

Type of field present in the param

[su](8|16|32) are integer types, signed and unsigned respectively, with the appropriate bit sizes.

Variants§

§

s8

Signed integer with size of 8 bits

§

u8

Unsigned integer with size of 8 bits

Fields

§bit_size: Option<u8>

Optionally limited to number of bits to be read

§

s16

Signed integer with size of 16 bits

§

u16

Unsigned integer with size of 16 bits

Fields

§bit_size: Option<u8>

Optionally limited to number of bits to be read

§

s32

Signed integer with size of 32 bits

§

u32

Unsigned integer with size of 32 bits

Fields

§bit_size: Option<u8>

Optionally limited to number of bits to be read

§

b32

Boolean value represented with 32 bits. 0 == false, !0 == true.

§

f32

Single-precision floating point

§

a32

Single-precision floating point, but this time references an angle. No real difference to ParamFieldType::f32

§

f64

Double-precision floating point

§

fixstr

Fixed-length string encoded in ShiftJIS.

Fields

§length: usize

Length of fixed-length string

§

fixstrW

Fixed-length string encoded in UTF16.

Fields

§length: usize

Length of fixed-length string

§

dummy8

Unused or unknown bytes or bits, likely used for padding

Fields

§length: Option<DummyType>

Length of dummy data. 1 byte if None.

Implementations§

Source§

impl ParamFieldType

Source

pub fn set_bit_size(&mut self, new_bit_size: u8)

Sets the bit size of a field type, on field types that support variable bit lengths.

§Panics

Panics when the field type does not support bit size definitions. See ParamFieldType::supports_bit_size

Source

pub fn supports_bit_size(&self) -> bool

Whether the given field type supports bit size definitions

Trait Implementations§

Source§

impl Debug for ParamFieldType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ParamFieldType

Source§

fn eq(&self, other: &ParamFieldType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ParamFieldType

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.