Enum quad_compat_rhai::plugin::CallableFunction[][src]

pub enum CallableFunction {
    Pure(Shared<dyn Fn(NativeCallContext<'_>, &mut [&'_ mut Dynamic]) -> Result<Dynamic, Box<EvalAltResult>>>),
    Method(Shared<dyn Fn(NativeCallContext<'_>, &mut [&'_ mut Dynamic]) -> Result<Dynamic, Box<EvalAltResult>>>),
    Iterator(fn(_: Dynamic) -> Box<dyn Iterator<Item = Dynamic>>),
    Plugin(Shared<dyn PluginFunction>),
    Script(Shared<ScriptFnDef>),
}
Expand description

A type encapsulating a function callable by Rhai.

Variants

Pure(Shared<dyn Fn(NativeCallContext<'_>, &mut [&'_ mut Dynamic]) -> Result<Dynamic, Box<EvalAltResult>>>)

Tuple Fields

A pure native Rust function with all arguments passed by value.

Method(Shared<dyn Fn(NativeCallContext<'_>, &mut [&'_ mut Dynamic]) -> Result<Dynamic, Box<EvalAltResult>>>)

Tuple Fields

A native Rust object method with the first argument passed by reference, and the rest passed by value.

Iterator(fn(_: Dynamic) -> Box<dyn Iterator<Item = Dynamic>>)

Tuple Fields

0: fn(_: Dynamic) -> Box<dyn Iterator<Item = Dynamic>>

An iterator function.

Plugin(Shared<dyn PluginFunction>)

Tuple Fields

A plugin function,

Script(Shared<ScriptFnDef>)

Tuple Fields

A script-defined function.

Not available under no_function.

Implementations

Is this a pure native Rust function?

Is this a native Rust method function?

Is this an iterator function?

Is this a Rhai-scripted function?

Is this a plugin function?

Is this a native Rust function?

Get the access mode.

Get a shared reference to a native Rust function.

Get a shared reference to a script-defined function definition.

Not available under no_function.

Get a reference to an iterator function.

Get a shared reference to a plugin function.

Create a new CallableFunction::Pure.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.