pub struct PodSlotHashes { /* private fields */ }
Expand description
API for querying of the SlotHashes
sysvar by on-chain programs.
Hangs onto the allocated raw buffer from the account data, which can be
queried or accessed directly as a slice of PodSlotHash
.
Implementations§
Source§impl PodSlotHashes
impl PodSlotHashes
Sourcepub fn fetch() -> Result<PodSlotHashes, ProgramError>
pub fn fetch() -> Result<PodSlotHashes, ProgramError>
Fetch all of the raw sysvar data using the sol_get_sysvar
syscall.
Sourcepub fn as_slice(&self) -> Result<&[PodSlotHash], ProgramError>
pub fn as_slice(&self) -> Result<&[PodSlotHash], ProgramError>
Return the SlotHashes
sysvar data as a slice of PodSlotHash
.
Returns a slice of only the initialized sysvar data.
Trait Implementations§
Source§impl Default for PodSlotHashes
impl Default for PodSlotHashes
Source§fn default() -> PodSlotHashes
fn default() -> PodSlotHashes
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PodSlotHashes
impl RefUnwindSafe for PodSlotHashes
impl Send for PodSlotHashes
impl Sync for PodSlotHashes
impl Unpin for PodSlotHashes
impl UnwindSafe for PodSlotHashes
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
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more