pub struct Runtime { /* private fields */ }Implementations§
Source§impl Runtime
impl Runtime
pub fn clear(&mut self)
pub fn define_function( &mut self, name: Name, func: CompFunc, stmt_index: Option<usize>, stmt_hash: Hash, )
pub fn define_constructor( &mut self, name: Name, arity: u64, stmt_index: Option<usize>, stmt_hash: Hash, )
pub fn define_register( &mut self, name: Name, stmt_index: Option<usize>, stmt_hash: Hash, )
pub fn save_stmt_name( &mut self, name: Name, stmt_index: Option<usize>, stmt_hash: Hash, )
pub fn create_term( &mut self, term: &Term, loc: Loc, vars_data: &mut NameMap<Vec<RawCell>>, ) -> Result<RawCell, RuntimeError>
pub fn alloc_term(&mut self, term: &Term) -> Result<Loc, RuntimeError>
pub fn collect(&mut self, term: RawCell)
pub fn collect_at(&mut self, loc: Loc)
pub fn run_statements( &mut self, statements: &[Statement], silent: bool, debug: bool, ) -> Vec<StatementResult> ⓘ
pub fn run_statements_from_code( &mut self, code: &str, silent: bool, debug: bool, ) -> Vec<StatementResult> ⓘ
pub fn test_statements( &mut self, statements: &[Statement], ) -> Vec<StatementResult> ⓘ
pub fn test_statements_from_code(&mut self, code: &str) -> Vec<StatementResult> ⓘ
pub fn compute_at( &mut self, loc: Loc, mana: u64, ) -> Result<RawCell, RuntimeError>
pub fn compute( &mut self, lnk: RawCell, mana: u64, ) -> Result<RawCell, RuntimeError>
pub fn normalize( &mut self, host: Loc, mana: u64, seen: &mut HashSet<RawCell>, ) -> Result<RawCell, RuntimeError>
pub fn show_term(&self, lnk: RawCell) -> String
pub fn show_term_at(&self, loc: Loc) -> String
pub fn get_heap(&self, index: u64) -> &Heap
pub fn get_heap_mut(&mut self, index: u64) -> &mut Heap
pub fn run_io( &mut self, subject: U120, caller: U120, host: Loc, mana: u64, ) -> Result<RawCell, RuntimeError>
Sourcepub fn get_subject(&mut self, sign: &Option<Signature>, hash: &Hash) -> U120
pub fn get_subject(&mut self, sign: &Option<Signature>, hash: &Hash) -> U120
Gets the subject of a signature.
- If there is no signature, returns
0. - If there is a signature, but subject cannot be retrieved correctly,
returns
1. - Else, returns the subject.
pub fn check_num( &mut self, ptr: RawCell, mana: u64, ) -> Result<U120, RuntimeError>
pub fn check_name( &mut self, ptr: RawCell, mana: u64, ) -> Result<Name, RuntimeError>
pub fn can_deploy(&mut self, subj: U120, name: &Name) -> bool
pub fn can_register(&mut self, subj: U120, name: &Name) -> bool
Sourcepub fn run_statement(
&mut self,
statement: &Statement,
silent: bool,
sudo: bool,
stmt_index: Option<usize>,
) -> StatementResult
pub fn run_statement( &mut self, statement: &Statement, silent: bool, sudo: bool, stmt_index: Option<usize>, ) -> StatementResult
Run statement in the draw heap.
It doesn’t alter curr heap.
pub fn get_mana_limit(&self) -> u64
pub fn get_size_limit(&self) -> u64
pub fn get_back(&self) -> Arc<Rollback> ⓘ
pub fn snapshot(&mut self)
pub fn rollback(&mut self, tick: u64)
pub fn get_dir_path(&self) -> PathBuf
pub fn save_state_metadata(&self) -> Result<()>
pub fn restore_state(&mut self) -> Result<()>
pub fn clear_current_heap(&mut self)
pub fn get_with<A: PartialEq>( &self, zero: A, none: A, get: impl Fn(&Heap) -> A, ) -> A
pub fn get_func(&self, name: &Name) -> Option<Arc<CompFunc>>
pub fn reduce_with<A>(&self, acc: &mut A, reduce: impl Fn(&mut A, &Heap))
pub fn write(&mut self, idx: Loc, val: RawCell)
pub fn read(&self, idx: Loc) -> RawCell
pub fn write_disk(&mut self, name: U120, val: RawCell)
pub fn read_disk(&self, name: U120) -> Option<RawCell>
pub fn read_disk_as_term( &mut self, name: U120, limit: Option<usize>, ) -> Option<Term>
pub fn read_file(&self, name: &Name) -> Option<CompFunc>
pub fn get_arity(&self, name: &Name) -> Option<u64>
pub fn set_arity(&mut self, name: Name, arity: u64)
pub fn get_owner(&self, name: &Name) -> Option<U120>
pub fn set_owner(&mut self, name: Name, owner: U120)
pub fn get_index(&mut self, name: &Name) -> Option<u128>
pub fn get_sth0(&mut self, pos: u128) -> Option<u128>
pub fn get_sth1(&mut self, pos: u128) -> Option<u128>
pub fn exists(&self, name: &Name) -> bool
pub fn get_dups(&self) -> u64
pub fn set_rwts(&mut self, rwts: u64)
pub fn get_rwts(&self) -> u64
pub fn set_mana(&mut self, mana: u64)
pub fn get_mana(&self) -> u64
pub fn set_tick(&mut self, tick: u64)
pub fn get_tick(&self) -> u64
pub fn set_time(&mut self, time: u128)
pub fn get_time(&self) -> u128
pub fn set_meta(&mut self, meta: u128)
pub fn get_meta(&self) -> u128
pub fn set_hax0(&mut self, hax0: u128)
pub fn get_hax0(&self) -> u128
pub fn set_hax1(&mut self, hax1: u128)
pub fn get_hax1(&self) -> u128
pub fn set_size(&mut self, size: u64)
pub fn get_size(&self) -> u64
pub fn set_mcap(&mut self, mcap: u64)
pub fn get_mcap(&self) -> u64
pub fn set_next(&mut self, next: u64)
pub fn get_next(&self) -> u64
pub fn fresh_dups(&mut self) -> u64
pub fn get_all_funs(&self) -> Vec<Name>
pub fn get_all_ctr(&self) -> Vec<Name>
pub fn get_all_ns(&self) -> Vec<Name>
Auto Trait Implementations§
impl Freeze for Runtime
impl RefUnwindSafe for Runtime
impl Send for Runtime
impl Sync for Runtime
impl Unpin for Runtime
impl UnsafeUnpin for Runtime
impl UnwindSafe for Runtime
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more