Skip to main content

ScriptRet

Trait ScriptRet 

Source
pub trait ScriptRet {
    // Required methods
    fn script_ty() -> ScriptTy;
    fn into_script_result(self) -> ScriptResult;
}
Expand description

What a ScriptFn::from_fn closure may return: a value, or a Result whose error message reaches the script.

The declared return type is T either way, so the same declaration binds a closure that can fail and one that cannot.

Required Methods§

Source

fn script_ty() -> ScriptTy

The declared return type.

Source

fn into_script_result(self) -> ScriptResult

The result the body hands the host.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T: ScriptType> ScriptRet for Result<T, String>

Implementors§