pub struct Stakes<T: Clone> { /* private fields */ }
Expand description
The generic type T is either Delegation or StakeAccount.
Stakes<Delegation>
is equivalent to the old code and is used for backward
compatibility in crate::bank::BankFieldsToDeserialize
.
But banks cache Stakes<StakeAccount>
which includes the entire stake
account and StakeStateV2 deserialized from the account. Doing so, will remove
the need to load the stake account from accounts-db when working with
stake-delegations.
Implementations§
source§impl<T: Clone> Stakes<T>
impl<T: Clone> Stakes<T>
pub fn vote_accounts(&self) -> &VoteAccounts
Trait Implementations§
source§impl<'de, T> Deserialize<'de> for Stakes<T>where
T: Deserialize<'de> + Clone,
impl<'de, T> Deserialize<'de> for Stakes<T>where
T: Deserialize<'de> + Clone,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<Stakes<Delegation>> for StakesEnum
impl From<Stakes<Delegation>> for StakesEnum
source§fn from(stakes: Stakes<Delegation>) -> Self
fn from(stakes: Stakes<Delegation>) -> Self
Converts to this type from the input type.
source§impl From<Stakes<StakeAccount<Delegation>>> for Stakes<Delegation>
impl From<Stakes<StakeAccount<Delegation>>> for Stakes<Delegation>
source§fn from(stakes: Stakes<StakeAccount<Delegation>>) -> Self
fn from(stakes: Stakes<StakeAccount<Delegation>>) -> Self
Converts to this type from the input type.
source§impl From<Stakes<StakeAccount<Delegation>>> for StakesEnum
impl From<Stakes<StakeAccount<Delegation>>> for StakesEnum
source§fn from(stakes: Stakes<StakeAccount<Delegation>>) -> Self
fn from(stakes: Stakes<StakeAccount<Delegation>>) -> Self
Converts to this type from the input type.
impl<T: Clone> StructuralPartialEq for Stakes<T>
Auto Trait Implementations§
impl<T> !Freeze for Stakes<T>
impl<T> RefUnwindSafe for Stakes<T>where
T: RefUnwindSafe,
impl<T> Send for Stakes<T>
impl<T> Sync for Stakes<T>
impl<T> Unpin for Stakes<T>where
T: Unpin,
impl<T> UnwindSafe for Stakes<T>where
T: RefUnwindSafe + UnwindSafe,
Blanket Implementations§
source§impl<T> AbiEnumVisitor for T
impl<T> AbiEnumVisitor for T
default fn visit_for_abi( &self, _digester: &mut AbiDigester, ) -> Result<AbiDigester, DigestError>
source§impl<T> AbiEnumVisitor for T
impl<T> AbiEnumVisitor for T
default fn visit_for_abi( &self, digester: &mut AbiDigester, ) -> Result<AbiDigester, DigestError>
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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