ValidatorPool

Struct ValidatorPool 

Source
pub struct ValidatorPool<'a, S, const N: u16, const M: u16>{ /* 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>

Source

pub fn length(&self) -> u32

Source

pub fn pool(&mut self, operator: PublicAddress) -> Option<PoolDict<'_, S, M>>

Source

pub fn pool_at(&mut self, index: u32) -> Option<PoolDict<'_, S, M>>

Source

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.

Source

pub fn clear(&'a mut self)

Clear pool and it’s delegated stakes.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V