Skip to main content

Session

Struct Session 

Source
pub struct Session { /* private fields */ }
Expand description

One evaluation session.

Implementations§

Source§

impl Session

Source

pub fn new(config: Config) -> Self

Source

pub fn interrupt_flag(&self) -> Arc<AtomicBool> ⓘ

The flag that halts the running evaluation.

Source

pub fn frame(&self) -> &Waku

Source

pub fn reset(&mut self)

Forget every context and definition: a fresh interpreter, same frame.

Source

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.

Source

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.

Source

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.

Source

pub fn complete(&self, prefix: &str, file: Option<&Path>) -> Vec<Item>

Every name prefix completes to in file’s context (or the session’s), each with its namespace and doc line.

Source

pub fn doc(&self, name: &str, file: Option<&Path>) -> Option<Item>

What name is in file’s context (or the session’s): the first binding the resolution order reaches. pkg::name names a bidama’s definition and blue::name the builtin.

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