fn decodeLike
Decodes b as the result type of like (used to decode the value of a durable step when a pipeline resumes on another node). Panics when the bytes do not decode.
Example:
use std.saga
use std.ser { encode }
fn zero() -> i64 => 0
fn main() io {
let b = encode(&(41 as i64))!
print("{saga.decodeLike(&b, zero) + 1}")
}Output
42
pub(api) fn decodeLike<V: Serializable, effect F>(b: &bytes, like: fn() -> V F) -> VSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
b | &bytes |
like | fn() -> V F |
Returns
V
Effects
none declared (pure unless the body says otherwise)
Defined in: std/saga/saga.oxl:1191