pub struct GlobalState { /* private fields */ }
Implementations
sourceimpl GlobalState
impl GlobalState
sourcepub fn get_resource_for_spec(
&self,
is_mut_opt: Option<bool>,
addr: AccountAddress,
key: StructInstantiation
) -> Option<TypedValue>
pub fn get_resource_for_spec(
&self,
is_mut_opt: Option<bool>,
addr: AccountAddress,
key: StructInstantiation
) -> Option<TypedValue>
Get a reference to a resource from the address, return None if the resource does not exist
sourcepub fn get_resource_for_code(
&mut self,
is_mut_opt: Option<bool>,
addr: AccountAddress,
key: StructInstantiation
) -> Option<TypedValue>
pub fn get_resource_for_code(
&mut self,
is_mut_opt: Option<bool>,
addr: AccountAddress,
key: StructInstantiation
) -> Option<TypedValue>
Get a reference to a resource from the address, return None if the resource does not exist otherwise, update the set of addresses touched by the bytecode
sourcepub fn del_resource(
&mut self,
addr: AccountAddress,
key: StructInstantiation
) -> Option<TypedValue>
pub fn del_resource(
&mut self,
addr: AccountAddress,
key: StructInstantiation
) -> Option<TypedValue>
Remove a resource from the address, return the old resource (as struct) if exists
sourcepub fn put_resource(
&mut self,
addr: AccountAddress,
key: StructInstantiation,
object: TypedValue
) -> Option<TypedValue>
pub fn put_resource(
&mut self,
addr: AccountAddress,
key: StructInstantiation,
object: TypedValue
) -> Option<TypedValue>
Put a resource into the address, return the old resource (as struct) if exists
sourcepub fn has_resource(
&self,
addr: &AccountAddress,
key: &StructInstantiation
) -> bool
pub fn has_resource(
&self,
addr: &AccountAddress,
key: &StructInstantiation
) -> bool
Check whether the address has a resource
sourcepub fn emit_event(&mut self, guid: Vec<u8>, seq: u64, msg: TypedValue)
pub fn emit_event(&mut self, guid: Vec<u8>, seq: u64, msg: TypedValue)
Emit an event to the event store
sourcepub fn get_touched_addresses(&self) -> &BTreeSet<AccountAddress>
pub fn get_touched_addresses(&self) -> &BTreeSet<AccountAddress>
Output all the addresses that are touched by the bytecode so far
sourcepub fn delta(&self, old_state: &GlobalState) -> ChangeSet
pub fn delta(&self, old_state: &GlobalState) -> ChangeSet
Calculate the delta (i.e., a ChangeSet) against the old state
Trait Implementations
sourceimpl Clone for GlobalState
impl Clone for GlobalState
sourcefn clone(&self) -> GlobalState
fn clone(&self) -> GlobalState
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for GlobalState
impl Debug for GlobalState
sourceimpl Default for GlobalState
impl Default for GlobalState
sourcefn default() -> GlobalState
fn default() -> GlobalState
Returns the “default value” for a type. Read more
sourceimpl PartialEq<GlobalState> for GlobalState
impl PartialEq<GlobalState> for GlobalState
sourcefn eq(&self, other: &GlobalState) -> bool
fn eq(&self, other: &GlobalState) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
impl Eq for GlobalState
impl StructuralEq for GlobalState
impl StructuralPartialEq for GlobalState
Auto Trait Implementations
impl RefUnwindSafe for GlobalState
impl Send for GlobalState
impl Sync for GlobalState
impl Unpin for GlobalState
impl UnwindSafe for GlobalState
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.