OxL Справочник OxL
РусскийEnglish

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:

oxl✓ проверяется в CI
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}")
}
Вывод
42
pub(api) fn decodeLike<V: Serializable, effect F>(b: &bytes, like: fn() -> V F) -> V

С версии. 1.0.0-beta

Параметры

ИмяТип
b&bytes
likefn() -> V F

Возвращает

V

Эффекты

не объявлены (чистая, пока тело не говорит иное)

Определено в: std/saga/saga.oxl:1205

См. также