pub const ContainerOptions = struct whitespace_style: union(enum) { /// If true, wrap every field. If false do not. wrap: bool, /// Automatically decide whether to wrap or not based on the number of fields. Following /// the standard rule of thumb, containers with more than two fields are wrapped. fields: usize, } = .{ .wrap = true }The whitespace style that should be used for this container. Ignored if whitespace is off.
fn shouldWrap(self: ContainerOptions) bool42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58pub const ContainerOptions = struct {
/// The whitespace style that should be used for this container. Ignored if whitespace is off.
whitespace_style: union(enum) {
/// If true, wrap every field. If false do not.
wrap: bool,
/// Automatically decide whether to wrap or not based on the number of fields. Following
/// the standard rule of thumb, containers with more than two fields are wrapped.
fields: usize,
} = .{ .wrap = true },
fn shouldWrap(self: ContainerOptions) bool {
return switch (self.whitespace_style) {
.wrap => |wrap| wrap,
.fields => |fields| fields > 2,
};
}
}
Options for manual serialization of container types.