pub struct Session { /* private fields */ }Expand description
One evaluation session.
Implementations§
Source§impl Session
impl Session
pub fn new(config: Config) -> Self
Sourcepub fn interrupt_flag(&self) -> Arc<AtomicBool> ⓘ
pub fn interrupt_flag(&self) -> Arc<AtomicBool> ⓘ
The flag that halts the running evaluation.
pub fn frame(&self) -> &Waku
Sourcepub fn load(
&mut self,
file: &Path,
text: Option<&str>,
how: Load,
) -> Outcome<Vec<String>>
pub fn load( &mut self, file: &Path, text: Option<&str>, how: Load, ) -> Outcome<Vec<String>>
Load file (its text from text when given, else from disk) as a
fresh context, replacing any earlier load of it. Answers the names the
file defines.
Sourcepub fn eval(
&mut self,
code: &str,
file: Option<&Path>,
budget: Option<usize>,
) -> Outcome<String>
pub fn eval( &mut self, code: &str, file: Option<&Path>, budget: Option<usize>, ) -> Outcome<String>
Evaluate code in file’s context (loading its definitions first if
it is not loaded), or the session’s own when file is None. Answers
the value of the last form as canonical blue text.
Sourcepub fn expand(
&mut self,
code: &str,
file: Option<&Path>,
step: Step,
) -> Outcome<String>
pub fn expand( &mut self, code: &str, file: Option<&Path>, step: Step, ) -> Outcome<String>
Expand the macro call code one step or fully, in file’s context or
the session’s.
Auto Trait Implementations§
impl !Freeze for Session
impl !RefUnwindSafe for Session
impl !Sync for Session
impl !UnwindSafe for Session
impl Send for Session
impl Unpin for Session
impl UnsafeUnpin for Session
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