Trait TrapConsume

Source
pub trait TrapConsume<T> {
    type Rest;

    // Required method
    fn consume(self) -> Result<T, Self::Rest>;
}
Expand description

Consume T to get Rest.

For example, an interpreter may return two types of traps, a CallCreateTrap, and another customized trap. The standard invoker, however, can only handle CallCreateTrap. By implementing this trait, the standard invoker can handle just the CallCreateTrap, and then it returns Rest as an additional interrupt that is handled by the user.

Required Associated Types§

Source

type Rest

Rest type.

Required Methods§

Source

fn consume(self) -> Result<T, Self::Rest>

Consume T to get Rest.

Implementors§