Struct rusk_vm::NetworkState
source · [−]pub struct NetworkState { /* private fields */ }
Expand description
Implementations
Returns a new empty NetworkState
.
Returns a NetworkState
based on a schedule
pub fn get_contract<'a>(
&'a self,
contract_id: &ContractId
) -> Result<impl Deref<Target = Contract> + 'a, VMError>
pub fn get_contract<'a>(
&'a self,
contract_id: &ContractId
) -> Result<impl Deref<Target = Contract> + 'a, VMError>
Returns a reference to the specified contracts state in the head
state.
pub fn get_contract_mut<'a>(
&'a mut self,
contract_id: &ContractId
) -> Result<impl DerefMut<Target = Contract> + 'a, VMError>
pub fn get_contract_mut<'a>(
&'a mut self,
contract_id: &ContractId
) -> Result<impl DerefMut<Target = Contract> + 'a, VMError>
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.
pub fn deploy_with_id(
&mut self,
id: ContractId,
contract: Contract
) -> Result<ContractId, VMError>
pub fn deploy_with_id(
&mut self,
id: ContractId,
contract: Contract
) -> Result<ContractId, VMError>
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.
pub fn register_host_module<M>(&mut self, module: M) where
M: HostModule + 'static + Sync + Send,
pub fn register_host_module<M>(&mut self, module: M) where
M: HostModule + 'static + Sync + Send,
Register a host function handler.
pub fn get_contract_cast_state<C>(
&self,
contract_id: &ContractId
) -> Result<C, VMError> where
C: Canon,
pub fn get_contract_cast_state<C>(
&self,
contract_id: &ContractId
) -> Result<C, VMError> where
C: Canon,
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.
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl !RefUnwindSafe for NetworkState
impl Send for NetworkState
impl Sync for NetworkState
impl Unpin for NetworkState
impl !UnwindSafe for NetworkState
Blanket Implementations
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
pub fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
pub fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Mutably borrows from an owned value. Read more
pub fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
pub fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
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