Skip to main content

Runtime

Struct Runtime 

Source
pub struct Runtime { /* private fields */ }

Implementations§

Source§

impl Runtime

Source

pub fn clear(&mut self)

Source

pub fn define_function( &mut self, name: Name, func: CompFunc, stmt_index: Option<usize>, stmt_hash: Hash, )

Source

pub fn define_constructor( &mut self, name: Name, arity: u64, stmt_index: Option<usize>, stmt_hash: Hash, )

Source

pub fn define_register( &mut self, name: Name, stmt_index: Option<usize>, stmt_hash: Hash, )

Source

pub fn save_stmt_name( &mut self, name: Name, stmt_index: Option<usize>, stmt_hash: Hash, )

Source

pub fn create_term( &mut self, term: &Term, loc: Loc, vars_data: &mut NameMap<Vec<RawCell>>, ) -> Result<RawCell, RuntimeError>

Source

pub fn alloc_term(&mut self, term: &Term) -> Result<Loc, RuntimeError>

Source

pub fn collect(&mut self, term: RawCell)

Source

pub fn collect_at(&mut self, loc: Loc)

Source

pub fn run_statements( &mut self, statements: &[Statement], silent: bool, debug: bool, ) -> Vec<StatementResult> ⓘ

Source

pub fn run_statements_from_code( &mut self, code: &str, silent: bool, debug: bool, ) -> Vec<StatementResult> ⓘ

Source

pub fn test_statements( &mut self, statements: &[Statement], ) -> Vec<StatementResult> ⓘ

Source

pub fn test_statements_from_code(&mut self, code: &str) -> Vec<StatementResult> ⓘ

Source

pub fn compute_at( &mut self, loc: Loc, mana: u64, ) -> Result<RawCell, RuntimeError>

Source

pub fn compute( &mut self, lnk: RawCell, mana: u64, ) -> Result<RawCell, RuntimeError>

Source

pub fn normalize( &mut self, host: Loc, mana: u64, seen: &mut HashSet<RawCell>, ) -> Result<RawCell, RuntimeError>

Source

pub fn show_term(&self, lnk: RawCell) -> String

Source

pub fn show_term_at(&self, loc: Loc) -> String

Source

pub fn get_heap(&self, index: u64) -> &Heap

Source

pub fn get_heap_mut(&mut self, index: u64) -> &mut Heap

Source

pub fn run_io( &mut self, subject: U120, caller: U120, host: Loc, mana: u64, ) -> Result<RawCell, RuntimeError>

Source

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.
Source

pub fn check_num( &mut self, ptr: RawCell, mana: u64, ) -> Result<U120, RuntimeError>

Source

pub fn check_name( &mut self, ptr: RawCell, mana: u64, ) -> Result<Name, RuntimeError>

Source

pub fn can_deploy(&mut self, subj: U120, name: &Name) -> bool

Source

pub fn can_register(&mut self, subj: U120, name: &Name) -> bool

Source

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.

Source

pub fn get_mana_limit(&self) -> u64

Source

pub fn get_size_limit(&self) -> u64

Source

pub fn get_back(&self) -> Arc<Rollback> ⓘ

Source

pub fn open(&mut self)

Advances the heap time counter.

Source

pub fn commit(&mut self)

Saves past states for rollback.

Source

pub fn snapshot(&mut self)

Source

pub fn rollback(&mut self, tick: u64)

Source

pub fn get_dir_path(&self) -> PathBuf

Source

pub fn save_state_metadata(&self) -> Result<()>

Source

pub fn restore_state(&mut self) -> Result<()>

Source

pub fn clear_current_heap(&mut self)

Source

pub fn get_with<A: PartialEq>( &self, zero: A, none: A, get: impl Fn(&Heap) -> A, ) -> A

Source

pub fn get_func(&self, name: &Name) -> Option<Arc<CompFunc>>

Source

pub fn reduce_with<A>(&self, acc: &mut A, reduce: impl Fn(&mut A, &Heap))

Source

pub fn write(&mut self, idx: Loc, val: RawCell)

Source

pub fn read(&self, idx: Loc) -> RawCell

Source

pub fn write_disk(&mut self, name: U120, val: RawCell)

Source

pub fn read_disk(&self, name: U120) -> Option<RawCell>

Source

pub fn read_disk_as_term( &mut self, name: U120, limit: Option<usize>, ) -> Option<Term>

Source

pub fn read_file(&self, name: &Name) -> Option<CompFunc>

Source

pub fn get_arity(&self, name: &Name) -> Option<u64>

Source

pub fn set_arity(&mut self, name: Name, arity: u64)

Source

pub fn get_owner(&self, name: &Name) -> Option<U120>

Source

pub fn set_owner(&mut self, name: Name, owner: U120)

Source

pub fn get_index(&mut self, name: &Name) -> Option<u128>

Source

pub fn get_sth0(&mut self, pos: u128) -> Option<u128>

Source

pub fn get_sth1(&mut self, pos: u128) -> Option<u128>

Source

pub fn exists(&self, name: &Name) -> bool

Source

pub fn get_dups(&self) -> u64

Source

pub fn set_rwts(&mut self, rwts: u64)

Source

pub fn get_rwts(&self) -> u64

Source

pub fn set_mana(&mut self, mana: u64)

Source

pub fn get_mana(&self) -> u64

Source

pub fn set_tick(&mut self, tick: u64)

Source

pub fn get_tick(&self) -> u64

Source

pub fn set_time(&mut self, time: u128)

Source

pub fn get_time(&self) -> u128

Source

pub fn set_meta(&mut self, meta: u128)

Source

pub fn get_meta(&self) -> u128

Source

pub fn set_hax0(&mut self, hax0: u128)

Source

pub fn get_hax0(&self) -> u128

Source

pub fn set_hax1(&mut self, hax1: u128)

Source

pub fn get_hax1(&self) -> u128

Source

pub fn set_size(&mut self, size: u64)

Source

pub fn get_size(&self) -> u64

Source

pub fn set_mcap(&mut self, mcap: u64)

Source

pub fn get_mcap(&self) -> u64

Source

pub fn set_next(&mut self, next: u64)

Source

pub fn get_next(&self) -> u64

Source

pub fn fresh_dups(&mut self) -> u64

Source

pub fn get_all_funs(&self) -> Vec<Name>

Source

pub fn get_all_ctr(&self) -> Vec<Name>

Source

pub fn get_all_ns(&self) -> Vec<Name>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V