[−][src]Struct ketos::module::ModuleBuilder
Helper to build modules in Rust code.
Methods
impl ModuleBuilder
[src]
pub fn new(name: &str, scope: Scope) -> ModuleBuilder
[src]
Creates a new ModuleBuilder
for the given scope.
pub fn add_constant<T: Into<Value>>(self, name: &str, value: T) -> Self
[src]
Adds a constant value to the module.
pub fn add_doc(self, name: &str, doc: &str) -> Self
[src]
Adds a documentation string for the given name.
pub fn add_function(
self,
name: &str,
callback: FunctionImpl,
arity: Arity,
doc: Option<&'static str>
) -> Self
[src]
self,
name: &str,
callback: FunctionImpl,
arity: Arity,
doc: Option<&'static str>
) -> Self
Adds a function to the module.
pub fn add_value(self, name: &str, value: Value) -> Self
[src]
Adds a value to the module.
pub fn add_value_with_name<F>(self, name: &str, f: F) -> Self where
F: FnOnce(Name) -> Value,
[src]
F: FnOnce(Name) -> Value,
Adds a value to the module using the generated name value.
pub fn finish(self) -> Module
[src]
Consumes the builder and returns the new Module
.
Auto Trait Implementations
impl !Send for ModuleBuilder
impl !Sync for ModuleBuilder
Blanket Implementations
impl<T> AnyValue for T where
T: Any,
[src]
T: Any,
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,