Trait magnus::method::ReturnValue
source · pub trait ReturnValue: ReturnValue { }
Expand description
Trait marking types that can be returned to Ruby.
Implemented for the following types:
T
Yield<I>
YieldValues<I>
YieldSplat<I>
Result<T, magnus::Error>
Result<Yield<I>, magnus::Error>
Result<YieldValues<I>, magnus::Error>
Result<YieldSplat<I>, magnus::Error>
where I
implements Iterator<Item = T>
and T
implements Into<Value>
.
When is Err(magnus::Error)
returned to Ruby it will be conveted to and
raised as a Ruby exception.
Yield
, YieldValues
, and YieldSplat
allow returning a Rust
Iterator
to be bridged to Ruby method that calls a block with the
elements of that Iterator
.
Note: functions without a specified return value will return ()
. ()
implements Into<Value>
(converting to nil
).