pub struct SysvarCache { /* private fields */ }
Implementations§
Source§impl SysvarCache
impl SysvarCache
Sourcepub fn set_sysvar_for_tests<T: Sysvar + SysvarId>(&mut self, sysvar: &T)
pub fn set_sysvar_for_tests<T: Sysvar + SysvarId>(&mut self, sysvar: &T)
Overwrite a sysvar. For testing purposes only.
pub fn sysvar_id_to_buffer(&self, sysvar_id: &Pubkey) -> &Option<Vec<u8>>
pub fn get_clock(&self) -> Result<Arc<Clock>, InstructionError>
pub fn get_epoch_schedule(&self) -> Result<Arc<EpochSchedule>, InstructionError>
pub fn get_epoch_rewards(&self) -> Result<Arc<EpochRewards>, InstructionError>
pub fn get_rent(&self) -> Result<Arc<Rent>, InstructionError>
pub fn get_last_restart_slot( &self, ) -> Result<Arc<LastRestartSlot>, InstructionError>
pub fn get_stake_history(&self) -> Result<Arc<StakeHistory>, InstructionError>
pub fn get_slot_hashes(&self) -> Result<Arc<SlotHashes>, InstructionError>
pub fn get_fees(&self) -> Result<Arc<Fees>, InstructionError>
👎Deprecated
pub fn get_recent_blockhashes( &self, ) -> Result<Arc<RecentBlockhashes>, InstructionError>
👎Deprecated
pub fn fill_missing_entries<F: FnMut(&Pubkey, &mut dyn FnMut(&[u8]))>( &mut self, get_account_data: F, )
pub fn reset(&mut self)
Trait Implementations§
Source§impl Clone for SysvarCache
impl Clone for SysvarCache
Source§fn clone(&self) -> SysvarCache
fn clone(&self) -> SysvarCache
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SysvarCache
impl Debug for SysvarCache
Source§impl Default for SysvarCache
impl Default for SysvarCache
Source§fn default() -> SysvarCache
fn default() -> SysvarCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SysvarCache
impl RefUnwindSafe for SysvarCache
impl Send for SysvarCache
impl Sync for SysvarCache
impl Unpin for SysvarCache
impl UnwindSafe for SysvarCache
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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