pub trait CallManager: 'static {
    type Machine: Machine;
Show 18 methods fn new(
        machine: Self::Machine,
        gas_limit: i64,
        origin: Address,
        nonce: u64
    ) -> Self; fn send<K: Kernel<CallManager = Self>>(
        &mut self,
        from: ActorID,
        to: Address,
        method: MethodNum,
        params: &RawBytes,
        value: &TokenAmount
    ) -> Result<InvocationResult>; fn with_transaction(
        &mut self,
        f: impl FnOnce(&mut Self) -> Result<InvocationResult>
    ) -> Result<InvocationResult>; fn finish(self) -> (i64, Backtrace, Self::Machine); fn machine(&self) -> &Self::Machine; fn machine_mut(&mut self) -> &mut Self::Machine; fn gas_tracker(&self) -> &GasTracker; fn gas_tracker_mut(&mut self) -> &mut GasTracker; fn origin(&self) -> Address; fn nonce(&self) -> u64; fn next_actor_idx(&mut self) -> u64; fn price_list(&self) -> &PriceList { ... } fn context(&self) -> &MachineContext { ... } fn blockstore(&self) -> &<Self::Machine as Machine>::Blockstore { ... } fn externs(&self) -> &<Self::Machine as Machine>::Externs { ... } fn state_tree(&self) -> &StateTree<<Self::Machine as Machine>::Blockstore> { ... } fn state_tree_mut(
        &mut self
    ) -> &mut StateTree<<Self::Machine as Machine>::Blockstore> { ... } fn charge_gas(&mut self, charge: GasCharge<'_>) -> Result<()> { ... }
}
Expand description

The CallManager manages a single call stack.

When a top-level message is executed:

  1. The crate::executor::Executor creates a CallManager for that message, giving itself to the CallManager.
  2. The crate::executor::Executor calls the specified actor/method using CallManager::send().
  3. The CallManager then constructs a Kernel and executes the actual actor code on that kernel.
  4. If an actor calls another actor, the Kernel will:
    1. Detach the CallManager from itself.
    2. Call CallManager::send() to execute the new message.
    3. Re-attach the CallManager.
    4. Return.

Associated Types

The underlying Machine on top of which this CallManager executes.

Required methods

Construct a new call manager.

Send a message. The type parameter K specifies the the kernel on top of which the target actor should execute.

Execute some operation (usually a send) within a transaction.

Finishes execution, returning the gas used and the machine.

Returns a reference to the machine.

Returns a mutable reference to the machine.

Returns reference to the gas tracker.

Returns a mutable reference to the gas tracker.

Getter for origin actor.

Getter for message nonce.

Gets and increment the call-stack actor creation index.

Provided methods

Returns the current price list.

Returns the machine context.

Returns the blockstore.

Returns the externs.

Returns the state tree.

Returns a mutable state-tree.

Charge gas.

Implementors