solana_program::stake::state

Enum StakeState

source
pub enum StakeState {
    Uninitialized,
    Initialized(Meta),
    Stake(Meta, Stake),
    RewardsPool,
}
๐Ÿ‘ŽDeprecated since 1.17.0: Please use StakeStateV2 instead, and match the third StakeFlags field when matching StakeStateV2::Stake to resolve any breakage. For example, if let StakeState::Stake(meta, stake) becomes if let StakeStateV2::Stake(meta, stake, _stake_flags).

Variantsยง

ยง

Uninitialized

๐Ÿ‘ŽDeprecated since 1.17.0: Please use StakeStateV2 instead, and match the third StakeFlags field when matching StakeStateV2::Stake to resolve any breakage. For example, if let StakeState::Stake(meta, stake) becomes if let StakeStateV2::Stake(meta, stake, _stake_flags).
ยง

Initialized(Meta)

๐Ÿ‘ŽDeprecated since 1.17.0: Please use StakeStateV2 instead, and match the third StakeFlags field when matching StakeStateV2::Stake to resolve any breakage. For example, if let StakeState::Stake(meta, stake) becomes if let StakeStateV2::Stake(meta, stake, _stake_flags).
ยง

Stake(Meta, Stake)

๐Ÿ‘ŽDeprecated since 1.17.0: Please use StakeStateV2 instead, and match the third StakeFlags field when matching StakeStateV2::Stake to resolve any breakage. For example, if let StakeState::Stake(meta, stake) becomes if let StakeStateV2::Stake(meta, stake, _stake_flags).
ยง

RewardsPool

๐Ÿ‘ŽDeprecated since 1.17.0: Please use StakeStateV2 instead, and match the third StakeFlags field when matching StakeStateV2::Stake to resolve any breakage. For example, if let StakeState::Stake(meta, stake) becomes if let StakeStateV2::Stake(meta, stake, _stake_flags).

Implementationsยง

sourceยง

impl StakeState

source

pub const fn size_of() -> usize

The fixed number of bytes used to serialize each stake account

source

pub fn stake(&self) -> Option<Stake>

source

pub fn delegation(&self) -> Option<Delegation>

source

pub fn authorized(&self) -> Option<Authorized>

source

pub fn lockup(&self) -> Option<Lockup>

source

pub fn meta(&self) -> Option<Meta>

Trait Implementationsยง

sourceยง

impl AbiExample for StakeState

sourceยง

fn example() -> Self

sourceยง

impl BorshDeserialize for StakeState

sourceยง

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

sourceยง

fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>

Deserializes this instance from a given slice of bytes. Updates the buffer to point at the remaining bytes.
sourceยง

fn try_from_slice(v: &[u8]) -> Result<Self, Error>

Deserialize this instance from a slice of bytes.
sourceยง

fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>
where R: Read,

sourceยง

impl BorshDeserialize for StakeState

sourceยง

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

sourceยง

fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>

Deserializes this instance from a given slice of bytes. Updates the buffer to point at the remaining bytes.
sourceยง

fn try_from_slice(v: &[u8]) -> Result<Self, Error>

Deserialize this instance from a slice of bytes.
sourceยง

fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>
where R: Read,

sourceยง

impl BorshSerialize for StakeState

sourceยง

fn serialize<W: Write>(&self, writer: &mut W) -> Result<()>

sourceยง

impl BorshSerialize for StakeState

sourceยง

fn serialize<W: Write>(&self, writer: &mut W) -> Result<()>

sourceยง

fn try_to_vec(&self) -> Result<Vec<u8>, Error>

Serialize this instance into a vector of bytes.
sourceยง

impl Clone for StakeState

sourceยง

fn clone(&self) -> StakeState

Returns a copy of the value. Read more
1.0.0 ยท sourceยง

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
sourceยง

impl Debug for StakeState

sourceยง

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
sourceยง

impl Default for StakeState

sourceยง

fn default() -> StakeState

Returns the โ€œdefault valueโ€ for a type. Read more
sourceยง

impl<'de> Deserialize<'de> for StakeState

sourceยง

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 PartialEq for StakeState

sourceยง

fn eq(&self, other: &StakeState) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 ยท sourceยง

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
sourceยง

impl Serialize for StakeState

sourceยง

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
sourceยง

impl Copy for StakeState

sourceยง

impl StructuralPartialEq for StakeState

Auto Trait Implementationsยง

Blanket Implementationsยง

sourceยง

impl<T> AbiEnumVisitor for T
where T: Serialize + ?Sized,

sourceยง

default fn visit_for_abi( &self, _digester: &mut AbiDigester, ) -> Result<AbiDigester, DigestError>

sourceยง

impl<T> AbiEnumVisitor for T
where T: Serialize + AbiExample + ?Sized,

sourceยง

default fn visit_for_abi( &self, digester: &mut AbiDigester, ) -> Result<AbiDigester, DigestError>

sourceยง

impl<T> AbiExample for T

sourceยง

default fn example() -> T

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> CloneToUninit for T
where T: Clone,

sourceยง

unsafe fn clone_to_uninit(&self, dst: *mut T)

๐Ÿ”ฌThis is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> IntoEither for T

sourceยง

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 more
sourceยง

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
sourceยง

impl<T> Pointable for T

sourceยง

const ALIGN: usize = _

The alignment of pointer.
sourceยง

type Init = T

The type for initializers.
sourceยง

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
sourceยง

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
sourceยง

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
sourceยง

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
sourceยง

impl<T> Same for T

sourceยง

type Output = T

Should always be Self
sourceยง

impl<T> ToOwned for T
where T: Clone,

sourceยง

type Owned = T

The resulting type after obtaining ownership.
sourceยง

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
sourceยง

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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

sourceยง

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,