[]Struct eosio_system::GLOBAL2

pub struct GLOBAL2 { /* fields omitted */ }

Methods from Deref<Target = SingletonIndex<EosioGlobalState2>>

#[must_use] pub fn exists(&self) -> bool[src]

Checks if the singleton entry exists

#[must_use] pub fn get(&self) -> Option<Result<<T as Table>::Row, ReadError>>[src]

Gets the value stored inside the singleton. Returns None if no value is found, or ReadError if there was an issue reading the data.

pub fn get_or_default(&self) -> Result<<T as Table>::Row, ReadError> where
    <T as Table>::Row: Default
[src]

Gets the value stored inside the singleton or returns the default value.

Errors

Will return Err if there was an issue deserializing the stored value.

pub fn set(
    &self,
    value: &<T as Table>::Row,
    payer: AccountName
) -> Result<(), WriteError>
[src]

Sets the singleton value

Errors

Will return Err if there was an issue serializing the value.

pub fn remove(&self) -> Result<Option<<T as Table>::Row>, ReadError>[src]

Removes the singleton value if it exists. Returns ReadError if there was an issue reading the data, and None if there was no entry found

Errors

Will return Err if there was an issue reading the stored value.

Trait Implementations

impl Deref for GLOBAL2

type Target = SingletonIndex<EosioGlobalState2>

The resulting type after dereferencing.

impl LazyStatic for GLOBAL2

Auto Trait Implementations

impl RefUnwindSafe for GLOBAL2

impl Send for GLOBAL2

impl Sync for GLOBAL2

impl Unpin for GLOBAL2

impl UnwindSafe for GLOBAL2

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.