OxL Reference

interface Serializable

Types that std.ser can encode and decode, and that can cross the network (@derive(Serializable), implicit for plain data).

Example:

oxl✓ checked in CI
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}")
}
Output
3 4
@explicit pub(api) interface Serializable

Since. 1.0.0-beta

Defined in: std/core/types.oxl:1038

See also