pub struct NetworkState { /* private fields */ }
Expand description

The main network state.

It keeps two different states, the origin and the head. The origin is the starting state, and head is origin with all the received transactions applied.

It is possible to either commit to the head state, turning it into the new origin, or reset it back to origin.

Implementations

Returns a new empty NetworkState.

Returns a NetworkState based on a schedule

Returns a reference to the specified contracts state in the head state.

Returns a mutable reference to the specified contracts state in the origin state.

Deploys a contract to the head state, returning the address of the created contract or an error.

Deploys a contract to the head state with the given id / address.

Query the contract at target address in the head state.

Transact with the contract at target address in the head state, returning the result of the transaction.

This will advance the head to the resultant state.

Returns the root of the tree in the head state.

Resets the head state to origin.

Commits to the head state, making it the new origin.

Register a host function handler.

Gets the state of the given contract in the head state.

Gets module config

Trait Implementations

Custom implementation of Canon ensuring only the head state is encoded. When restored, head is set to be a copy of origin and the modules are to be set by the caller.

Write the encoded value as bytes to a Sink

Return the decoded value from bytes in a Source

Returns the number of bytes needed to encode this value

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

The archived version of the pointer metadata for this type.

Converts some archived metadata to the pointer metadata for itself.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Deserializes using the given deserializer

Encode Self into a buffer

Performs the conversion.

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

Performs the conversion.

Return a reference to the key of the leaf type

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type for metadata in pointers and references to Self.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. 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