Skip to main content

State

Trait State 

Source
pub trait State {
Show 40 methods // Required methods fn get(&mut self, acc: &Acc, key: &Int) -> Option<(Int, Int)>; fn put(&mut self, acc: &Acc, key: &Int, val: Int) -> Option<Int>; fn init(&mut self, acc: &Acc, key: &Int, val: Int); fn tget(&mut self, acc: &Acc, key: &Int) -> Option<Int>; fn tput(&mut self, acc: Acc, key: Int, val: Int) -> Option<Int>; fn inc_nonce(&mut self, acc: &Acc, nonce: Int) -> Int; fn set_value(&mut self, acc: &Acc, value: Int) -> Int; fn set_code(&mut self, acc: &Acc, code: Buf, hash: Int) -> Int; fn set_auth(&mut self, src: &Acc, dst: &Acc); fn merge(&mut self, acc: &Acc, chain: Account); fn balance(&mut self, acc: &Acc) -> Option<Int>; fn nonce(&mut self, acc: &Acc) -> Option<Int>; fn code(&mut self, acc: &Acc) -> Option<(Buf, Int)>; fn acc(&mut self, acc: &Acc) -> Option<Account>; fn is_cold_acc(&self, acc: &Acc) -> bool; fn is_cold_key(&self, acc: &Acc, key: &Int) -> bool; fn warm_acc(&mut self, acc: &Acc) -> bool; fn warm_key(&mut self, acc: &Acc, key: &Int) -> bool; fn create(&mut self, acc: Acc, info: Account); fn destroy(&mut self, acc: &Acc); fn hash(&mut self, number: u64, hash: Int); fn log(&mut self, data: Buf, topics: Vec<Int>); fn head(&self, number: u64) -> Option<Head>; fn auth(&self, acc: &Acc) -> Option<Acc>; fn created(&self) -> Vec<Acc> ; fn destroyed(&self) -> Vec<Acc> ; fn apply(&mut self); fn emit(&mut self, event: Event) -> usize; // Provided methods fn get_depth(&mut self) -> usize { ... } fn set_depth(&mut self, _depth: usize) { ... } fn save_fetched(&mut self, _fetched: Fetched) { ... } fn next_fetched(&mut self) -> Option<Fetched> { ... } fn prefetched(&mut self, _: Vec<Fetched>) { ... } fn is_offline(&self) -> bool { ... } fn reset(&mut self) { ... } fn checkpoint(&mut self) -> usize { ... } fn revert_to(&mut self, _checkpoint: usize) { ... } fn set_chain_id(&mut self, _id: u64) { ... } fn get_chain_id(&self) -> u64 { ... } fn is_tracing(&self) -> bool { ... }
}

Required Methods§

Source

fn get(&mut self, acc: &Acc, key: &Int) -> Option<(Int, Int)>

Source

fn put(&mut self, acc: &Acc, key: &Int, val: Int) -> Option<Int>

Source

fn init(&mut self, acc: &Acc, key: &Int, val: Int)

Source

fn tget(&mut self, acc: &Acc, key: &Int) -> Option<Int>

Source

fn tput(&mut self, acc: Acc, key: Int, val: Int) -> Option<Int>

Source

fn inc_nonce(&mut self, acc: &Acc, nonce: Int) -> Int

Source

fn set_value(&mut self, acc: &Acc, value: Int) -> Int

Source

fn set_code(&mut self, acc: &Acc, code: Buf, hash: Int) -> Int

Source

fn set_auth(&mut self, src: &Acc, dst: &Acc)

Source

fn merge(&mut self, acc: &Acc, chain: Account)

Source

fn balance(&mut self, acc: &Acc) -> Option<Int>

Source

fn nonce(&mut self, acc: &Acc) -> Option<Int>

Source

fn code(&mut self, acc: &Acc) -> Option<(Buf, Int)>

Source

fn acc(&mut self, acc: &Acc) -> Option<Account>

Source

fn is_cold_acc(&self, acc: &Acc) -> bool

Source

fn is_cold_key(&self, acc: &Acc, key: &Int) -> bool

Source

fn warm_acc(&mut self, acc: &Acc) -> bool

Source

fn warm_key(&mut self, acc: &Acc, key: &Int) -> bool

Source

fn create(&mut self, acc: Acc, info: Account)

Source

fn destroy(&mut self, acc: &Acc)

Source

fn hash(&mut self, number: u64, hash: Int)

Source

fn log(&mut self, data: Buf, topics: Vec<Int>)

Source

fn head(&self, number: u64) -> Option<Head>

Source

fn auth(&self, acc: &Acc) -> Option<Acc>

Source

fn created(&self) -> Vec<Acc>

Source

fn destroyed(&self) -> Vec<Acc>

Source

fn apply(&mut self)

Source

fn emit(&mut self, event: Event) -> usize

Provided Methods§

Source

fn get_depth(&mut self) -> usize

Source

fn set_depth(&mut self, _depth: usize)

Source

fn save_fetched(&mut self, _fetched: Fetched)

Source

fn next_fetched(&mut self) -> Option<Fetched>

Source

fn prefetched(&mut self, _: Vec<Fetched>)

Source

fn is_offline(&self) -> bool

Source

fn reset(&mut self)

Source

fn checkpoint(&mut self) -> usize

Take a state checkpoint; returns an opaque ID that can be passed to revert_to.

Source

fn revert_to(&mut self, _checkpoint: usize)

Revert all state mutations since the given checkpoint.

Source

fn set_chain_id(&mut self, _id: u64)

Source

fn get_chain_id(&self) -> u64

Source

fn is_tracing(&self) -> bool

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§