pub struct StakeCache(pub Arc<RwLock<StakeCacheData>>);Expand description
A cache of stake and validator accounts.
This wraps StakeCacheData in Arc<RwLock<...>> to allow thread-safe shared
access during parallel transaction execution. The Arc allows the same data
to be shared between the Bank and StakesHandle, so mutations to pending
stake data by builtin programs are visible to the Bank.
Tuple Fields§
§0: Arc<RwLock<StakeCacheData>>Implementations§
Source§impl StakeCache
impl StakeCache
Sourcepub fn with_data(data: StakeCacheData) -> Self
pub fn with_data(data: StakeCacheData) -> Self
Create a stake cache with the given data.
Sourcepub fn from_arc(arc: Arc<RwLock<StakeCacheData>>) -> Self
pub fn from_arc(arc: Arc<RwLock<StakeCacheData>>) -> Self
Create a stake cache from an existing Arc (for sharing references).
Sourcepub fn arc_clone(&self) -> Arc<RwLock<StakeCacheData>>
pub fn arc_clone(&self) -> Arc<RwLock<StakeCacheData>>
Get a clone of the inner Arc for sharing.
Trait Implementations§
Source§impl Clone for StakeCache
impl Clone for StakeCache
Source§fn clone(&self) -> StakeCache
fn clone(&self) -> StakeCache
Returns a duplicate 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 StakeCache
impl Debug for StakeCache
Auto Trait Implementations§
impl Freeze for StakeCache
impl RefUnwindSafe for StakeCache
impl Send for StakeCache
impl Sync for StakeCache
impl Unpin for StakeCache
impl UnsafeUnpin for StakeCache
impl UnwindSafe for StakeCache
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> 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