pub struct PluginFnBuilder { /* private fields */ }Expand description
Builder for a PluginFn. Start it with PluginFn::new.
Implementations§
Source§impl PluginFnBuilder
impl PluginFnBuilder
Sourcepub fn param(self, name: impl Into<String>, ty: ScriptTy) -> Self
pub fn param(self, name: impl Into<String>, ty: ScriptTy) -> Self
Append a required parameter. Call in argument order.
Sourcepub fn ret(self, ty: ScriptTy) -> Self
pub fn ret(self, ty: ScriptTy) -> Self
Set the return type. Defaults to ScriptTy::Any; a function whose
result really is open declares ScriptTy::Dynamic.
Sourcepub fn doc(self, doc: impl Into<String>) -> Self
pub fn doc(self, doc: impl Into<String>) -> Self
Set the one-line description editor tooling shows.
Sourcepub fn ns(self, ns: ScriptNs) -> Self
pub fn ns(self, ns: ScriptNs) -> Self
Choose the namespace. Defaults to ScriptNs::Extension.
ScriptNs::Builtin is the runtime’s own surface and a host refuses
a manifest that claims it.
Sourcepub fn min_arity(self, min_arity: usize) -> Self
pub fn min_arity(self, min_arity: usize) -> Self
Make the trailing parameters optional: a call may pass as few as
min_arity arguments, and the body reads the rest as
ScriptValue::Unit.
Auto Trait Implementations§
impl Freeze for PluginFnBuilder
impl RefUnwindSafe for PluginFnBuilder
impl Send for PluginFnBuilder
impl Sync for PluginFnBuilder
impl Unpin for PluginFnBuilder
impl UnsafeUnpin for PluginFnBuilder
impl UnwindSafe for PluginFnBuilder
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.