interface Serializable
Types that std.ser can encode and decode, and that can cross the network (@derive(Serializable), implicit for plain data).
Example:
use std.ser { encode, decode }
data Point { x: i32; y: i32 }
fn main() io {
let bytes = encode(&Point{ x: 3, y: 4 })!
let p = decode<Point>(&bytes)!
print("{p.x} {p.y}")
}Вывод
3 4
@explicit pub(api) interface SerializableС версии. 1.0.0-beta
Определено в: std/core/types.oxl:1038