pub const OptionalIndex = enum(u8) 234
235
236
237
238
239
240
241
242
243
244
245
246
247
248 pub const OptionalIndex = enum(u8) {
none = std.math.maxInt(u8),
/// Index into `node_storage`.
_,
pub fn unwrap(i: @This()) ?Index {
if (i == .none) return null;
return @fromBackingInt(@intCast(@backingInt(i)));
}
fn toParent(i: @This()) Parent {
assert(@backingInt(i) != @backingInt(Parent.unused));
return @fromBackingInt(@intCast(@backingInt(i)));
}
}