[][src]Struct ketos::interpreter::Builder

pub struct Builder { /* fields omitted */ }

Builds an Interpreter with configured parameters.

Some methods are mutually exclusive. For example, a Scope contains a ModuleLoader instance. Therefore, the builder will panic if both a Scope and a ModuleLoader are supplied.

Example


let interp = Builder::new()
    .name("foo")
    // ...
    .finish();

// ...

Methods

impl Builder[src]

pub fn new() -> Builder[src]

Creates a new Builder.

pub fn name(self, name: &'static str) -> Self[src]

Sets the name of the new scope.

pub fn context(self, ctx: Context) -> Self[src]

Sets the context of the new interpreter.

pub fn restrict(self, restrict: RestrictConfig) -> Self[src]

Sets the restriction configuration in the new context.

pub fn scope(self, scope: Scope) -> Self[src]

Sets the scope in the new context.

pub fn struct_defs(self, defs: Rc<RefCell<StructDefMap>>) -> Self[src]

Sets the struct definitions in the new context.

pub fn io(self, io: Rc<GlobalIo>) -> Self[src]

Sets the I/O handles in the new scope.

pub fn module_loader(self, loader: Box<dyn ModuleLoader>) -> Self[src]

Sets the module loader in the new scope.

pub fn search_paths(self, paths: Vec<PathBuf>) -> Self[src]

Sets the search paths for a new FileModuleLoader.

pub fn finish(self) -> Interpreter[src]

Consumes the Builder and creates an Interpreter.

Auto Trait Implementations

impl !RefUnwindSafe for Builder

impl !Send for Builder

impl !Sync for Builder

impl Unpin for Builder

impl !UnwindSafe for Builder

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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