fn decode
Decodes b into a T; errors per [С §9.4].
Example:
use std.ser { encode, decode }
fn main() io {
let b = encode(&"hi")!
let s: str = decode(&b)!
print(s)
}Вывод
hi
@intrinsic("ser.decode") pub(api) fn decode<T: Serializable>(b: &bytes, fmt: Format = Format.Oxl) -> T | DecodeErrorС версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
b | &bytes |
fmt | Format = Format.Oxl |
Возвращает
T
Ошибки
DecodeError@error
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/ser/ser.oxl:2306