Trait fvm::kernel::SelfOps

source ·
pub trait SelfOps: IpldBlockOps {
    // Required methods
    fn root(&mut self) -> Result<Cid>;
    fn set_root(&mut self, root: Cid) -> Result<()>;
    fn current_balance(&self) -> Result<TokenAmount>;
    fn self_destruct(&mut self, burn_unspent: bool) -> Result<()>;
}
Expand description

Actor state access and manipulation. Depends on BlockOps to read and write blocks in the state tree.

Required Methods§

source

fn root(&mut self) -> Result<Cid>

Get the state root.

source

fn set_root(&mut self, root: Cid) -> Result<()>

Update the state-root.

This method will fail if the new state-root isn’t reachable.

source

fn current_balance(&self) -> Result<TokenAmount>

The balance of the receiver.

source

fn self_destruct(&mut self, burn_unspent: bool) -> Result<()>

Deletes the executing actor from the state tree, burning any remaining balance if requested.

Implementors§