pub struct Program { /* private fields */ }Expand description
This structure is guaranteed to contain valid bytecode and debug info because it may only be constructed from source.
Implementations§
Source§impl Program
impl Program
Sourcepub fn eval<'host>(&self) -> Result<Value<'host>, Error>
pub fn eval<'host>(&self) -> Result<Value<'host>, Error>
§Errors
Returns an error if the evaluating the program’s root block results in an error
pub fn debug_info(&self) -> &[u8] ⓘ
pub fn locate_runtime_error(&self, e: &Error) -> Option<(usize, usize)>
Sourcepub fn from_str_with_diagnostics<'source>(
s: &'source str,
for_each: impl FnMut(Diagnostic),
) -> Result<Self, CompilerError<'source>>
pub fn from_str_with_diagnostics<'source>( s: &'source str, for_each: impl FnMut(Diagnostic), ) -> Result<Self, CompilerError<'source>>
Compiles an espy program after iterating through all diagnostics.
§Errors
Returns an error if any error diagnostics were found in the ast. Displaying this error is probably uneccessary if error diagnostics were already shown to the user.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Program
impl RefUnwindSafe for Program
impl !Send for Program
impl !Sync for Program
impl Unpin for Program
impl UnwindSafe for Program
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