pub struct ValidatorPool<'a, S, const N: u16, const M: u16>where
S: NetworkAccountStorage,{ /* private fields */ }Expand description
ValidatorPool defines the pool value to be stored in state of a Network Account. Different from PoolDict, fields are stored as a single value in the Key-Value storage, rather than assigning keyspaces to each fields as a dictionary.
Implementations§
Source§impl<'a, S, const N: u16, const M: u16> ValidatorPool<'a, S, N, M>where
S: NetworkAccountStorage,
impl<'a, S, const N: u16, const M: u16> ValidatorPool<'a, S, N, M>where
S: NetworkAccountStorage,
pub fn length(&self) -> u32
pub fn pool(&mut self, operator: PublicAddress) -> Option<PoolDict<'_, S, M>>
pub fn pool_at(&mut self, index: u32) -> Option<PoolDict<'_, S, M>>
Sourcepub fn push(
&'a mut self,
pool: Pool,
delegated_stakes: Vec<StakeValue>,
) -> Result<(), IndexMapOperationError>
pub fn push( &'a mut self, pool: Pool, delegated_stakes: Vec<StakeValue>, ) -> Result<(), IndexMapOperationError>
Push pool value to Index Map with reset of delegated stakes.
pub fn get(&self, index: u32) -> Option<PoolAddress>
Auto Trait Implementations§
impl<'a, S, const N: u16, const M: u16> Freeze for ValidatorPool<'a, S, N, M>
impl<'a, S, const N: u16, const M: u16> RefUnwindSafe for ValidatorPool<'a, S, N, M>where
S: RefUnwindSafe,
impl<'a, S, const N: u16, const M: u16> Send for ValidatorPool<'a, S, N, M>where
S: Send,
impl<'a, S, const N: u16, const M: u16> Sync for ValidatorPool<'a, S, N, M>where
S: Sync,
impl<'a, S, const N: u16, const M: u16> Unpin for ValidatorPool<'a, S, N, M>
impl<'a, S, const N: u16, const M: u16> !UnwindSafe for ValidatorPool<'a, S, N, M>
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