Struct solana_runtime::account_info::PackedOffsetAndFlags
source · #[repr(C)]pub struct PackedOffsetAndFlags {
bytes: [u8; 4],
}
Fields§
§bytes: [u8; 4]
Implementations§
source§impl PackedOffsetAndFlags
impl PackedOffsetAndFlags
sourcepub const fn into_bytes(self) -> [u8; 4]
pub const fn into_bytes(self) -> [u8; 4]
sourcepub const fn from_bytes(bytes: [u8; 4]) -> Self
pub const fn from_bytes(bytes: [u8; 4]) -> Self
Converts the given bytes directly into the bitfield struct.
source§impl PackedOffsetAndFlags
impl PackedOffsetAndFlags
sourcefn offset_reduced(&self) -> <B31 as Specifier>::InOut
fn offset_reduced(&self) -> <B31 as Specifier>::InOut
Returns the value of offset_reduced. this provides 2^31 bits, which when multipled by 8 (sizeof(u64)) = 16G, which is the maximum size of an append vec
sourcefn offset_reduced_or_err(
&self
) -> Result<<B31 as Specifier>::InOut, InvalidBitPattern<<B31 as Specifier>::Bytes>>
fn offset_reduced_or_err( &self ) -> Result<<B31 as Specifier>::InOut, InvalidBitPattern<<B31 as Specifier>::Bytes>>
Returns the value of offset_reduced.
#Errors
If the returned value contains an invalid bit pattern for offset_reduced. this provides 2^31 bits, which when multipled by 8 (sizeof(u64)) = 16G, which is the maximum size of an append vec
sourcefn with_offset_reduced(self, new_val: <B31 as Specifier>::InOut) -> Self
fn with_offset_reduced(self, new_val: <B31 as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of offset_reduced set to the given value.
#Panics
If the given value is out of bounds for offset_reduced. this provides 2^31 bits, which when multipled by 8 (sizeof(u64)) = 16G, which is the maximum size of an append vec
sourcefn with_offset_reduced_checked(
self,
new_val: <B31 as Specifier>::InOut
) -> Result<Self, OutOfBounds>
fn with_offset_reduced_checked( self, new_val: <B31 as Specifier>::InOut ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of offset_reduced set to the given value.
#Errors
If the given value is out of bounds for offset_reduced. this provides 2^31 bits, which when multipled by 8 (sizeof(u64)) = 16G, which is the maximum size of an append vec
sourcefn set_offset_reduced(&mut self, new_val: <B31 as Specifier>::InOut)
fn set_offset_reduced(&mut self, new_val: <B31 as Specifier>::InOut)
Sets the value of offset_reduced to the given value.
#Panics
If the given value is out of bounds for offset_reduced. this provides 2^31 bits, which when multipled by 8 (sizeof(u64)) = 16G, which is the maximum size of an append vec
sourcefn set_offset_reduced_checked(
&mut self,
new_val: <B31 as Specifier>::InOut
) -> Result<(), OutOfBounds>
fn set_offset_reduced_checked( &mut self, new_val: <B31 as Specifier>::InOut ) -> Result<(), OutOfBounds>
Sets the value of offset_reduced to the given value.
#Errors
If the given value is out of bounds for offset_reduced. this provides 2^31 bits, which when multipled by 8 (sizeof(u64)) = 16G, which is the maximum size of an append vec
sourcefn is_zero_lamport(&self) -> <bool as Specifier>::InOut
fn is_zero_lamport(&self) -> <bool as Specifier>::InOut
Returns the value of is_zero_lamport. use 1 bit to specify that the entry is zero lamport
sourcefn is_zero_lamport_or_err(
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
fn is_zero_lamport_or_err( &self ) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of is_zero_lamport.
#Errors
If the returned value contains an invalid bit pattern for is_zero_lamport. use 1 bit to specify that the entry is zero lamport
sourcefn with_is_zero_lamport(self, new_val: <bool as Specifier>::InOut) -> Self
fn with_is_zero_lamport(self, new_val: <bool as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of is_zero_lamport set to the given value.
#Panics
If the given value is out of bounds for is_zero_lamport. use 1 bit to specify that the entry is zero lamport
sourcefn with_is_zero_lamport_checked(
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
fn with_is_zero_lamport_checked( self, new_val: <bool as Specifier>::InOut ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of is_zero_lamport set to the given value.
#Errors
If the given value is out of bounds for is_zero_lamport. use 1 bit to specify that the entry is zero lamport
sourcefn set_is_zero_lamport(&mut self, new_val: <bool as Specifier>::InOut)
fn set_is_zero_lamport(&mut self, new_val: <bool as Specifier>::InOut)
Sets the value of is_zero_lamport to the given value.
#Panics
If the given value is out of bounds for is_zero_lamport. use 1 bit to specify that the entry is zero lamport
sourcefn set_is_zero_lamport_checked(
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
fn set_is_zero_lamport_checked( &mut self, new_val: <bool as Specifier>::InOut ) -> Result<(), OutOfBounds>
Sets the value of is_zero_lamport to the given value.
#Errors
If the given value is out of bounds for is_zero_lamport. use 1 bit to specify that the entry is zero lamport
Trait Implementations§
source§impl Clone for PackedOffsetAndFlags
impl Clone for PackedOffsetAndFlags
source§fn clone(&self) -> PackedOffsetAndFlags
fn clone(&self) -> PackedOffsetAndFlags
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PackedOffsetAndFlags
impl Debug for PackedOffsetAndFlags
source§impl Default for PackedOffsetAndFlags
impl Default for PackedOffsetAndFlags
source§fn default() -> PackedOffsetAndFlags
fn default() -> PackedOffsetAndFlags
source§impl PartialEq<PackedOffsetAndFlags> for PackedOffsetAndFlags
impl PartialEq<PackedOffsetAndFlags> for PackedOffsetAndFlags
source§fn eq(&self, other: &PackedOffsetAndFlags) -> bool
fn eq(&self, other: &PackedOffsetAndFlags) -> bool
self
and other
values to be equal, and is used
by ==
.impl Copy for PackedOffsetAndFlags
impl Eq for PackedOffsetAndFlags
impl StructuralEq for PackedOffsetAndFlags
impl StructuralPartialEq for PackedOffsetAndFlags
Auto Trait Implementations§
impl RefUnwindSafe for PackedOffsetAndFlags
impl Send for PackedOffsetAndFlags
impl Sync for PackedOffsetAndFlags
impl Unpin for PackedOffsetAndFlags
impl UnwindSafe for PackedOffsetAndFlags
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.