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 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> 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