pub const OptionalIndex = enum(u32) pub fn unwrap(oi: OptionalIndex) ?Indexpub fn fromOptional(oi: ?Index) OptionalIndex2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950 pub const OptionalIndex = enum(u32) {
root = 0,
none = std.math.maxInt(u32),
_,
pub fn unwrap(oi: OptionalIndex) ?Index {
return if (oi == .none) null else @fromBackingInt(@intCast(@backingInt(oi)));
}
pub fn fromOptional(oi: ?Index) OptionalIndex {
return if (oi) |i| i.toOptional() else .none;
}
}
Index into
nodes, or null.