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)
}Output
hi
@intrinsic("ser.decode") pub(api) fn decode<T: Serializable>(b: &bytes, fmt: Format = Format.Oxl) -> T | DecodeErrorSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
b | &bytes |
fmt | Format = Format.Oxl |
Returns
T
Errors
DecodeError@error
Effects
none declared (pure unless the body says otherwise)
Defined in: std/ser/ser.oxl:2306