pub struct Program { /* private fields */ }
Expand description
Programs are containers holding statics and a pointer to the main parselet.
A program is the result of a successful compiler run.
Implementations
sourceimpl Program
impl Program
pub fn new(statics: Vec<RefValue>) -> Self
sourcepub fn main(&self) -> &ParseletRef
pub fn main(&self) -> &ParseletRef
Returns a reference to the program’s main parselet.
pub fn dump(&self)
pub fn run(
&self,
runtime: &mut Runtime<'_, '_>
) -> Result<Option<RefValue>, Error>
pub fn run_from_reader(&self, reader: Reader) -> Result<Option<RefValue>, Error>
pub fn run_from_str(&self, src: &'static str) -> Result<Option<RefValue>, Error>
pub fn run_from_string(&self, src: String) -> Result<Option<RefValue>, Error>
pub fn run_from_file(&self, filename: &str) -> Result<Option<RefValue>, Error>
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Program
impl !Send for Program
impl !Sync for Program
impl Unpin for Program
impl !UnwindSafe for Program
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more