logo
pub struct RuntimeContext<'a, R> { /* private fields */ }
Expand description

Holds information specific to the deployed contract.

Implementations

Creates new runtime context where we don’t already have one.

Where we already have a runtime context, consider using new_from_self().

Creates new runtime context cloning values from self.

Returns all authorization keys for this deploy.

Returns a named key by a name if it exists.

Returns named keys.

Returns a mutable reference to named keys.

Checks if named keys contains a key referenced by name.

Remove Key from the named_keys map of the current context. It removes both from the ephemeral map (RuntimeContext::named_keys) but also persistable map (one that is found in the TrackingCopy/GlobalState).

Returns the caller of the contract.

Returns the block time.

Returns the deploy hash.

Extends access rights with a new map.

Returns a mapping of access rights for each URefs address.

Returns account of the caller.

Returns arguments.

Returns new shared instance of an address generator.

Returns the gas limit.

Returns the current gas counter.

Sets the gas counter to a new value.

Returns the base key.

This could be either a Key::Account or a Key::Hash depending on the entry point type.

Returns the protocol version.

Returns the correlation id.

Returns the current phase.

Generates new deterministic hash for uses as an address.

Creates new URef instance.

Creates a new transfer address using a transfer address generator.

Puts key to the map of named keys of current context.

Read a stored value under a Key.

Reads a value from a global state directly.

Usage

DO NOT EXPOSE THIS VIA THE FFI - This function bypasses security checks and should be used with caution.

This method is a wrapper over read_gs in the sense that it extracts the type held by a StoredValue stored in the global state in a type safe manner.

This is useful if you want to get the exact type from global state.

Returns all keys based on the tag prefix.

Read an account from the global state.

Write an account to the global state.

Write a transfer instance to the global state.

Write an era info instance to the global state.

Grants access to a URef; unless access was pre-existing.

Removes an access right from the current runtime context.

Returns current effects of a tracking copy.

Returns an ExecutionJournal.

Returns list of transfers.

Returns mutable list of transfers.

Tests whether reading from the key is valid.

Tests whether addition to key is valid.

Tests whether writing to key is valid.

Gets main purse id

Gets entry point type.

Puts a dictionary item key from a dictionary referenced by a uref.

Returns system contract registry by querying the global state.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Converts self into a target type. Read more

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Causes self to use its Binary implementation when Debug-formatted.

Causes self to use its Display implementation when Debug-formatted. Read more

Causes self to use its LowerExp implementation when Debug-formatted. Read more

Causes self to use its LowerHex implementation when Debug-formatted. Read more

Causes self to use its Octal implementation when Debug-formatted.

Causes self to use its Pointer implementation when Debug-formatted. Read more

Causes self to use its UpperExp implementation when Debug-formatted. Read more

Causes self to use its UpperHex implementation when Debug-formatted. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Pipes a value into a function that cannot ordinarily be called in suffix position. Read more

Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more

Pipes a dereference into a function that cannot normally be called in suffix position. Read more

Pipes a mutable dereference into a function that cannot normally be called in suffix position. Read more

Pipes a reference into a function that cannot ordinarily be called in suffix position. Read more

Pipes a mutable reference into a function that cannot ordinarily be called in suffix position. Read more

Should always be Self

Provides immutable access for inspection. Read more

Calls tap in debug builds, and does nothing in release builds.

Provides mutable access for modification. Read more

Calls tap_mut in debug builds, and does nothing in release builds.

Provides immutable access to the reference for inspection.

Calls tap_ref in debug builds, and does nothing in release builds.

Provides mutable access to the reference for modification.

Calls tap_ref_mut in debug builds, and does nothing in release builds.

Provides immutable access to the borrow for inspection. Read more

Calls tap_borrow in debug builds, and does nothing in release builds.

Provides mutable access to the borrow for modification.

Calls tap_borrow_mut in debug builds, and does nothing in release builds. Read more

Immutably dereferences self for inspection.

Calls tap_deref in debug builds, and does nothing in release builds.

Mutably dereferences self for modification.

Calls tap_deref_mut in debug builds, and does nothing in release builds. Read more

Attempts to convert self into a target type. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more