Skip to main content

IntoHostResult

Trait IntoHostResult 

Source
pub trait IntoHostResult {
    // Required methods
    fn into_host_result(self) -> Result<Value, HostError>;
    fn host_type() -> HostType;
}
Expand description

What a registered host closure returns: a value, or an error to raise in the script that called it.

Implemented for every IntoHostValue, so an infallible closure returns a plain i64/String/Vec<T>/…, and for Result<T, HostError>, so a fallible one returns that instead. Either way the host type checked against the host block is T’s.

Required Methods§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T> IntoHostResult for Result<T, HostError>
where T: IntoHostValue,

Implementors§

Source§

impl<T> IntoHostResult for T
where T: IntoHostValue,