Skip to main content

AccountMode

Enum AccountMode 

Source
#[repr(u8)]
pub enum AccountMode { Placeholder = 0, ReadOnly = 1, System = 2, Delegated = 3, Ephemeral = 4, Transient = 5, Closed = 255, }
Expand description

Mutually exclusive modes an account can occupy in the ephemeral rollup (ER).

Variants§

§

Placeholder = 0

Empty account (not found on chain) used to avoid frequent chain syncs.

§

ReadOnly = 1

Not writable by users (exists on chain, but not delegated)

§

System = 2

Internal account used for sysvars, features, and precompiles.

§

Delegated = 3

Account delegated to the current ER node instance.

§

Ephemeral = 4

Account that exists only inside the ER.

§

Transient = 5

Temporary state during mode transitions (e.g. delegated -> readonly).

§

Closed = 255

Closed account that should be removed from storage.

Implementations§

Source§

impl AccountMode

Source

pub fn allows_transition(self, to: Self, from_slot: Slot, to_slot: Slot) -> bool

Returns whether a privileged lifecycle operation may apply to at to_slot, including same-mode refreshes and slot ordering.

Only placeholder, read-only, and system accounts permit same-mode refreshes, and those require a newer slot. Slots may never regress.

Source

pub fn mutable(&self) -> bool

Returns true for modes that may be mutated by user programs.

Source

pub fn authoritative(&self) -> bool

Returns true for modes whose state is authoritative in this engine.

Trait Implementations§

Source§

impl Clone for AccountMode

Source§

fn clone(&self) -> AccountMode

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for AccountMode

Source§

impl Debug for AccountMode

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for AccountMode

Source§

fn default() -> AccountMode

Returns the “default value” for a type. Read more
Source§

impl Eq for AccountMode

Source§

impl PartialEq for AccountMode

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AccountMode

Auto Trait Implementations§

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.