pub struct Config {
pub admin: Pubkey,
pub vault_program: Pubkey,
pub bump: u8,
/* private fields */
}Expand description
The global configuration account for the restaking program. Manages program-wide settings and state.
Fields§
§admin: PubkeyThe configuration admin
vault_program: PubkeyThe vault program
bump: u8The bump seed for the PDA
Implementations§
Source§impl Config
impl Config
pub fn new(admin: Pubkey, vault_program: Pubkey, bump: u8) -> Self
pub fn epoch_length(&self) -> u64
pub fn ncn_count(&self) -> u64
pub fn operator_count(&self) -> u64
pub fn increment_ncn_count(&mut self) -> Result<(), RestakingError>
pub fn increment_operator_count(&mut self) -> Result<(), RestakingError>
Sourcepub fn load(
program_id: &Pubkey,
account: &AccountInfo<'_>,
expect_writable: bool,
) -> Result<(), ProgramError>
pub fn load( program_id: &Pubkey, account: &AccountInfo<'_>, expect_writable: bool, ) -> Result<(), ProgramError>
pub fn set_admin(&mut self, new_admin: Pubkey)
Trait Implementations§
Source§impl AccountDeserialize for Config
impl AccountDeserialize for Config
Source§fn try_from_slice_unchecked(data: &[u8]) -> Result<&Self, ProgramError>
fn try_from_slice_unchecked(data: &[u8]) -> Result<&Self, ProgramError>
Deserialize the account data into a struct.
It assumes the first byte is the discriminator and the next seven bytes are reserved.
The rest of the data is deserialized into the struct. Read more
Source§fn try_from_slice_unchecked_mut(
data: &mut [u8],
) -> Result<&mut Self, ProgramError>
fn try_from_slice_unchecked_mut( data: &mut [u8], ) -> Result<&mut Self, ProgramError>
Deserialize the account data into a mutable struct.
It assumes the first byte is the discriminator and the next seven bytes are reserved.
The rest of the data is deserialized into the struct. Read more
Source§impl Discriminator for Config
impl Discriminator for Config
const DISCRIMINATOR: u8
impl Copy for Config
impl Eq for Config
impl Pod for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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