enum OptionalIndex [src]
Index into nodes, or null.
Fields
root = 0
none = std.math.maxInt(u32)
_
Members
- fromOptional (Function)
- unwrap (Function)
Source
pub const OptionalIndex = enum(u32) {
root = 0,
none = std.math.maxInt(u32),
_,
pub fn unwrap(oi: OptionalIndex) ?Index {
return if (oi == .none) null else @enumFromInt(@intFromEnum(oi));
}
pub fn fromOptional(oi: ?Index) OptionalIndex {
return if (oi) |i| i.toOptional() else .none;
}
}