[−]Struct eosio_system::GLOBAL2
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]
<T as Table>::Row: Default,
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]
&self,
value: &<T as Table>::Row,
payer: AccountName
) -> Result<(), WriteError>
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.
fn deref(&self) -> &SingletonIndex<EosioGlobalState2>
impl LazyStatic for GLOBAL2
fn initialize(lazy: &Self)
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,