OxL Reference

interface Copy

Marks a type whose values are copied instead of moved (@derive(Copy)).

Example:

oxl✓ checked in CI
@derive(Copy)
data Point { x: i32; y: i32 }

fn main() io {
  let a = Point{ x: 1, y: 2 }
  let b = a
  print("{a.x} {b.y}")
}
Output
1 2
@explicit pub(api) interface Copy

Since. 1.0.0-beta

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

See also