fmapOr

Undocumented in source.
template fmapOr(alias pred)
fmapOr
(
U
T
E
)
(
auto ref scope Result!(T, E) result
,
auto ref scope U other
)

Members

Functions

fmapOr
auto fmapOr(Result!(T, E) result, U other)
Undocumented in source. Be warned that the author may not have intended to support it.

Examples

// source: https://doc.rust-lang.org/std/result/enum.Result.html#method.map_or
auto x = Result!string.ok("foo");
assert(x.fmapOr!(str => str.length)(42) == 3);

auto y = Result!string.err("bar");
assert(y.fmapOr!(str => str.length)(42) == 42);

Meta