[−][src]Struct ketos::interpreter::Builder
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,