Zig 0.17.0-dev (Split by item)
This is an example of documentation generated by
ZigDoc , an alternative to Zig's built-in
Auto Doc feature. See also
examples in other modes/formats . The project being documented here (as the example) is the Zig library itself.
Zig › std/ › Build/ › Configuration.zig › OptionalStringList
OptionalStringList
Configuration.OptionalStringList
pub const OptionalStringList = enum (u32 )
File
Code
pub const OptionalStringList = enum (u32 ) {
none = max_u32 ,
_ ,
pub fn init (opt_string_list : ?StringList ) OptionalStringList {
const sl = opt_string_list orelse return .none ;
const result : OptionalStringList = @fromBackingInt (@intCast (@backingInt (sl )));
assert (result != .none );
return result ;
}
pub fn unwrap (this : @This ()) ?StringList {
if (this == .none ) return null ;
return @fromBackingInt (@intCast (@backingInt (this )));
}
pub fn slice (this : @This (), c : *const Configuration ) ?[]const String {
return (unwrap (this ) orelse return null ).slice (c );
}
}