[][src]Struct smash_arc::HashToIndex

pub struct HashToIndex { /* fields omitted */ }

A mapping from a hash to an index into another list, used for the hash lookup tables in the format

Implementations

impl HashToIndex[src]

pub fn hash40(&self) -> Hash40[src]

impl HashToIndex[src]

pub const fn new() -> Self[src]

Returns an instance with zero initialized data.

impl HashToIndex[src]

pub const fn into_bytes(self) -> [u8; 8][src]

Returns the underlying bits.

Layout

The returned byte array is layed out in the same way as described here.

pub const fn from_bytes(bytes: [u8; 8]) -> Self[src]

Converts the given bytes directly into the bitfield struct.

impl HashToIndex[src]

pub fn hash(&self) -> <u32 as Specifier>::InOut[src]

Returns the value of hash.

pub fn hash_or_err(
    &self
) -> Result<<u32 as Specifier>::InOut, InvalidBitPattern<<u32 as Specifier>::Bytes>>
[src]

Returns the value of hash.

#Errors

If the returned value contains an invalid bit pattern for hash.

pub fn with_hash(mut self: Self, new_val: <u32 as Specifier>::InOut) -> Self[src]

Returns a copy of the bitfield with the value of hash set to the given value.

#Panics

If the given value is out of bounds for hash.

pub fn with_hash_checked(
    mut self: Self,
    new_val: <u32 as Specifier>::InOut
) -> Result<Self, OutOfBounds>
[src]

Returns a copy of the bitfield with the value of hash set to the given value.

#Errors

If the given value is out of bounds for hash.

pub fn set_hash(&mut self, new_val: <u32 as Specifier>::InOut)[src]

Sets the value of hash to the given value.

#Panics

If the given value is out of bounds for hash.

pub fn set_hash_checked(
    &mut self,
    new_val: <u32 as Specifier>::InOut
) -> Result<(), OutOfBounds>
[src]

Sets the value of hash to the given value.

#Errors

If the given value is out of bounds for hash.

pub fn length(&self) -> <u8 as Specifier>::InOut[src]

Returns the value of length.

pub fn length_or_err(
    &self
) -> Result<<u8 as Specifier>::InOut, InvalidBitPattern<<u8 as Specifier>::Bytes>>
[src]

Returns the value of length.

#Errors

If the returned value contains an invalid bit pattern for length.

pub fn with_length(mut self: Self, new_val: <u8 as Specifier>::InOut) -> Self[src]

Returns a copy of the bitfield with the value of length set to the given value.

#Panics

If the given value is out of bounds for length.

pub fn with_length_checked(
    mut self: Self,
    new_val: <u8 as Specifier>::InOut
) -> Result<Self, OutOfBounds>
[src]

Returns a copy of the bitfield with the value of length set to the given value.

#Errors

If the given value is out of bounds for length.

pub fn set_length(&mut self, new_val: <u8 as Specifier>::InOut)[src]

Sets the value of length to the given value.

#Panics

If the given value is out of bounds for length.

pub fn set_length_checked(
    &mut self,
    new_val: <u8 as Specifier>::InOut
) -> Result<(), OutOfBounds>
[src]

Sets the value of length to the given value.

#Errors

If the given value is out of bounds for length.

pub fn index(&self) -> <B24 as Specifier>::InOut[src]

Returns the value of index.

pub fn index_or_err(
    &self
) -> Result<<B24 as Specifier>::InOut, InvalidBitPattern<<B24 as Specifier>::Bytes>>
[src]

Returns the value of index.

#Errors

If the returned value contains an invalid bit pattern for index.

pub fn with_index(mut self: Self, new_val: <B24 as Specifier>::InOut) -> Self[src]

Returns a copy of the bitfield with the value of index set to the given value.

#Panics

If the given value is out of bounds for index.

pub fn with_index_checked(
    mut self: Self,
    new_val: <B24 as Specifier>::InOut
) -> Result<Self, OutOfBounds>
[src]

Returns a copy of the bitfield with the value of index set to the given value.

#Errors

If the given value is out of bounds for index.

pub fn set_index(&mut self, new_val: <B24 as Specifier>::InOut)[src]

Sets the value of index to the given value.

#Panics

If the given value is out of bounds for index.

pub fn set_index_checked(
    &mut self,
    new_val: <B24 as Specifier>::InOut
) -> Result<(), OutOfBounds>
[src]

Sets the value of index to the given value.

#Errors

If the given value is out of bounds for index.

Trait Implementations

impl BinRead for HashToIndex[src]

type Args = ()

The type of arguments needed to be supplied in order to read this type, usually a tuple. Read more

impl CheckTotalSizeMultipleOf8 for HashToIndex[src]

type Size = TotalSize<[(); 0]>

impl Clone for HashToIndex[src]

impl Copy for HashToIndex[src]

impl Debug for HashToIndex[src]

impl From<&'_ HashToIndex> for Hash40[src]

impl From<HashToIndex> for Hash40[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.