[−][src]Struct smash_arc::HashToIndex
A mapping from a hash to an index into another list, used for the hash lookup tables in the format
Implementations
impl HashToIndex
[src]
impl HashToIndex
[src]
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]
&self
) -> Result<<u32 as Specifier>::InOut, InvalidBitPattern<<u32 as Specifier>::Bytes>>
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]
mut self: Self,
new_val: <u32 as Specifier>::InOut
) -> Result<Self, OutOfBounds>
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]
&mut self,
new_val: <u32 as Specifier>::InOut
) -> Result<(), OutOfBounds>
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]
&self
) -> Result<<u8 as Specifier>::InOut, InvalidBitPattern<<u8 as Specifier>::Bytes>>
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]
mut self: Self,
new_val: <u8 as Specifier>::InOut
) -> Result<Self, OutOfBounds>
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]
&mut self,
new_val: <u8 as Specifier>::InOut
) -> Result<(), OutOfBounds>
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]
&self
) -> Result<<B24 as Specifier>::InOut, InvalidBitPattern<<B24 as Specifier>::Bytes>>
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]
mut self: Self,
new_val: <B24 as Specifier>::InOut
) -> Result<Self, OutOfBounds>
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]
&mut self,
new_val: <B24 as Specifier>::InOut
) -> Result<(), OutOfBounds>
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
fn read_options<R: Read + Seek>(
__binread_generated_var_reader: &mut R,
__binread_generated_var_options: &ReadOptions,
__binread_generated_var_arguments: Self::Args
) -> BinResult<Self>
[src]
__binread_generated_var_reader: &mut R,
__binread_generated_var_options: &ReadOptions,
__binread_generated_var_arguments: Self::Args
) -> BinResult<Self>
fn after_parse<R: Read + Seek>(
&mut self,
__binread_generated_var_reader: &mut R,
__binread_generated_var_options: &ReadOptions,
__binread_generated_var_arguments: Self::Args
) -> BinResult<()>
[src]
&mut self,
__binread_generated_var_reader: &mut R,
__binread_generated_var_options: &ReadOptions,
__binread_generated_var_arguments: Self::Args
) -> BinResult<()>
pub fn read<R>(reader: &mut R) -> Result<Self, Error> where
R: Read + Seek,
[src]
R: Read + Seek,
pub fn read_args<R>(reader: &mut R, args: Self::Args) -> Result<Self, Error> where
R: Read + Seek,
[src]
R: Read + Seek,
pub fn args_default() -> Option<Self::Args>
[src]
impl CheckTotalSizeMultipleOf8 for HashToIndex
[src]
impl Clone for HashToIndex
[src]
fn clone(&self) -> HashToIndex
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for HashToIndex
[src]
impl Debug for HashToIndex
[src]
impl From<&'_ HashToIndex> for Hash40
[src]
fn from(hash_index: &HashToIndex) -> Self
[src]
impl From<HashToIndex> for Hash40
[src]
fn from(hash_index: HashToIndex) -> Self
[src]
Auto Trait Implementations
impl RefUnwindSafe for HashToIndex
[src]
impl Send for HashToIndex
[src]
impl Sync for HashToIndex
[src]
impl Unpin for HashToIndex
[src]
impl UnwindSafe for HashToIndex
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,