Struct solana_bucket_map::index_entry::PackedRefCount
source · #[repr(C)]pub(crate) struct PackedRefCount {
bytes: [u8; 8],
}
Expand description
hold a big RefCount
while leaving room for extra bits to be used for things like ‘Occupied’
Fields§
§bytes: [u8; 8]
Implementations§
source§impl PackedRefCount
impl PackedRefCount
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 PackedRefCount
impl PackedRefCount
sourcepub(crate) fn occupied(&self) -> <B1 as Specifier>::InOut
pub(crate) fn occupied(&self) -> <B1 as Specifier>::InOut
Returns the value of occupied. whether this entry in the data file is occupied or not
sourcepub(crate) fn occupied_or_err(
&self
) -> Result<<B1 as Specifier>::InOut, InvalidBitPattern<<B1 as Specifier>::Bytes>>
pub(crate) fn occupied_or_err( &self ) -> Result<<B1 as Specifier>::InOut, InvalidBitPattern<<B1 as Specifier>::Bytes>>
Returns the value of occupied.
#Errors
If the returned value contains an invalid bit pattern for occupied. whether this entry in the data file is occupied or not
sourcepub(crate) fn with_occupied(self, new_val: <B1 as Specifier>::InOut) -> Self
pub(crate) fn with_occupied(self, new_val: <B1 as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of occupied set to the given value.
#Panics
If the given value is out of bounds for occupied. whether this entry in the data file is occupied or not
sourcepub(crate) fn with_occupied_checked(
self,
new_val: <B1 as Specifier>::InOut
) -> Result<Self, OutOfBounds>
pub(crate) fn with_occupied_checked( self, new_val: <B1 as Specifier>::InOut ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of occupied set to the given value.
#Errors
If the given value is out of bounds for occupied. whether this entry in the data file is occupied or not
sourcepub(crate) fn set_occupied(&mut self, new_val: <B1 as Specifier>::InOut)
pub(crate) fn set_occupied(&mut self, new_val: <B1 as Specifier>::InOut)
Sets the value of occupied to the given value.
#Panics
If the given value is out of bounds for occupied. whether this entry in the data file is occupied or not
sourcepub(crate) fn set_occupied_checked(
&mut self,
new_val: <B1 as Specifier>::InOut
) -> Result<(), OutOfBounds>
pub(crate) fn set_occupied_checked( &mut self, new_val: <B1 as Specifier>::InOut ) -> Result<(), OutOfBounds>
Sets the value of occupied to the given value.
#Errors
If the given value is out of bounds for occupied. whether this entry in the data file is occupied or not
sourcepub(crate) fn ref_count(&self) -> <B63 as Specifier>::InOut
pub(crate) fn ref_count(&self) -> <B63 as Specifier>::InOut
Returns the value of ref_count. ref_count of this entry. We don’t need any where near 63 bits for this value
sourcepub(crate) fn ref_count_or_err(
&self
) -> Result<<B63 as Specifier>::InOut, InvalidBitPattern<<B63 as Specifier>::Bytes>>
pub(crate) fn ref_count_or_err( &self ) -> Result<<B63 as Specifier>::InOut, InvalidBitPattern<<B63 as Specifier>::Bytes>>
Returns the value of ref_count.
#Errors
If the returned value contains an invalid bit pattern for ref_count. ref_count of this entry. We don’t need any where near 63 bits for this value
sourcepub(crate) fn with_ref_count(self, new_val: <B63 as Specifier>::InOut) -> Self
pub(crate) fn with_ref_count(self, new_val: <B63 as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of ref_count set to the given value.
#Panics
If the given value is out of bounds for ref_count. ref_count of this entry. We don’t need any where near 63 bits for this value
sourcepub(crate) fn with_ref_count_checked(
self,
new_val: <B63 as Specifier>::InOut
) -> Result<Self, OutOfBounds>
pub(crate) fn with_ref_count_checked( self, new_val: <B63 as Specifier>::InOut ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of ref_count set to the given value.
#Errors
If the given value is out of bounds for ref_count. ref_count of this entry. We don’t need any where near 63 bits for this value
sourcepub(crate) fn set_ref_count(&mut self, new_val: <B63 as Specifier>::InOut)
pub(crate) fn set_ref_count(&mut self, new_val: <B63 as Specifier>::InOut)
Sets the value of ref_count to the given value.
#Panics
If the given value is out of bounds for ref_count. ref_count of this entry. We don’t need any where near 63 bits for this value
sourcepub(crate) fn set_ref_count_checked(
&mut self,
new_val: <B63 as Specifier>::InOut
) -> Result<(), OutOfBounds>
pub(crate) fn set_ref_count_checked( &mut self, new_val: <B63 as Specifier>::InOut ) -> Result<(), OutOfBounds>
Sets the value of ref_count to the given value.
#Errors
If the given value is out of bounds for ref_count. ref_count of this entry. We don’t need any where near 63 bits for this value
Trait Implementations§
source§impl Clone for PackedRefCount
impl Clone for PackedRefCount
source§fn clone(&self) -> PackedRefCount
fn clone(&self) -> PackedRefCount
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PackedRefCount
impl Debug for PackedRefCount
source§impl Default for PackedRefCount
impl Default for PackedRefCount
source§fn default() -> PackedRefCount
fn default() -> PackedRefCount
source§impl PartialEq<PackedRefCount> for PackedRefCount
impl PartialEq<PackedRefCount> for PackedRefCount
source§fn eq(&self, other: &PackedRefCount) -> bool
fn eq(&self, other: &PackedRefCount) -> bool
self
and other
values to be equal, and is used
by ==
.