Struct solana_bucket_map::index_entry::PackedStorage
source · #[repr(C)]struct PackedStorage {
bytes: [u8; 8],
}
Expand description
Pack the storage offset and capacity-when-crated-pow2 fields into a single u64
Fields§
§bytes: [u8; 8]
Implementations§
source§impl PackedStorage
impl PackedStorage
source§impl PackedStorage
impl PackedStorage
sourcepub const fn into_bytes(self) -> [u8; 8]
pub const fn into_bytes(self) -> [u8; 8]
sourcepub const fn from_bytes(bytes: [u8; 8]) -> Self
pub const fn from_bytes(bytes: [u8; 8]) -> Self
Converts the given bytes directly into the bitfield struct.
source§impl PackedStorage
impl PackedStorage
sourcefn capacity_when_created_pow2(&self) -> <B8 as Specifier>::InOut
fn capacity_when_created_pow2(&self) -> <B8 as Specifier>::InOut
Returns the value of capacity_when_created_pow2.
sourcefn capacity_when_created_pow2_or_err(
&self
) -> Result<<B8 as Specifier>::InOut, InvalidBitPattern<<B8 as Specifier>::Bytes>>
fn capacity_when_created_pow2_or_err( &self ) -> Result<<B8 as Specifier>::InOut, InvalidBitPattern<<B8 as Specifier>::Bytes>>
Returns the value of capacity_when_created_pow2.
#Errors
If the returned value contains an invalid bit pattern for capacity_when_created_pow2.
sourcefn with_capacity_when_created_pow2(
self,
new_val: <B8 as Specifier>::InOut
) -> Self
fn with_capacity_when_created_pow2( self, new_val: <B8 as Specifier>::InOut ) -> Self
Returns a copy of the bitfield with the value of capacity_when_created_pow2 set to the given value.
#Panics
If the given value is out of bounds for capacity_when_created_pow2.
sourcefn with_capacity_when_created_pow2_checked(
self,
new_val: <B8 as Specifier>::InOut
) -> Result<Self, OutOfBounds>
fn with_capacity_when_created_pow2_checked( self, new_val: <B8 as Specifier>::InOut ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of capacity_when_created_pow2 set to the given value.
#Errors
If the given value is out of bounds for capacity_when_created_pow2.
sourcefn set_capacity_when_created_pow2(&mut self, new_val: <B8 as Specifier>::InOut)
fn set_capacity_when_created_pow2(&mut self, new_val: <B8 as Specifier>::InOut)
Sets the value of capacity_when_created_pow2 to the given value.
#Panics
If the given value is out of bounds for capacity_when_created_pow2.
sourcefn set_capacity_when_created_pow2_checked(
&mut self,
new_val: <B8 as Specifier>::InOut
) -> Result<(), OutOfBounds>
fn set_capacity_when_created_pow2_checked( &mut self, new_val: <B8 as Specifier>::InOut ) -> Result<(), OutOfBounds>
Sets the value of capacity_when_created_pow2 to the given value.
#Errors
If the given value is out of bounds for capacity_when_created_pow2.
sourcefn offset_or_err(
&self
) -> Result<<B56 as Specifier>::InOut, InvalidBitPattern<<B56 as Specifier>::Bytes>>
fn offset_or_err( &self ) -> Result<<B56 as Specifier>::InOut, InvalidBitPattern<<B56 as Specifier>::Bytes>>
Returns the value of offset.
#Errors
If the returned value contains an invalid bit pattern for offset.
sourcefn with_offset(self, new_val: <B56 as Specifier>::InOut) -> Self
fn with_offset(self, new_val: <B56 as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of offset set to the given value.
#Panics
If the given value is out of bounds for offset.
sourcefn with_offset_checked(
self,
new_val: <B56 as Specifier>::InOut
) -> Result<Self, OutOfBounds>
fn with_offset_checked( self, new_val: <B56 as Specifier>::InOut ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of offset set to the given value.
#Errors
If the given value is out of bounds for offset.
sourcefn set_offset(&mut self, new_val: <B56 as Specifier>::InOut)
fn set_offset(&mut self, new_val: <B56 as Specifier>::InOut)
Sets the value of offset to the given value.
#Panics
If the given value is out of bounds for offset.
sourcefn set_offset_checked(
&mut self,
new_val: <B56 as Specifier>::InOut
) -> Result<(), OutOfBounds>
fn set_offset_checked( &mut self, new_val: <B56 as Specifier>::InOut ) -> Result<(), OutOfBounds>
Sets the value of offset to the given value.
#Errors
If the given value is out of bounds for offset.
Trait Implementations§
source§impl Clone for PackedStorage
impl Clone for PackedStorage
source§fn clone(&self) -> PackedStorage
fn clone(&self) -> PackedStorage
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PackedStorage
impl Debug for PackedStorage
source§impl Default for PackedStorage
impl Default for PackedStorage
source§fn default() -> PackedStorage
fn default() -> PackedStorage
source§impl PartialEq<PackedStorage> for PackedStorage
impl PartialEq<PackedStorage> for PackedStorage
source§fn eq(&self, other: &PackedStorage) -> bool
fn eq(&self, other: &PackedStorage) -> bool
self
and other
values to be equal, and is used
by ==
.