forFieldName
Helper for setting for_field_name after construction.
If for_field_name is set, these options will only apply to fields
field with that field name.
Useful for dealing with common struct such as dvui.Point where you want to display different fields of the same type using different widgets.
NOTE: Ordering is important. If there are multiple options for the same struct type order the field_name variants before the generic struct options.
Parameters
- self:Self
- Self
- field_name:[]const u8
- []const u8
Source
Implementation
pub fn forFieldName(self: Self, field_name: []const u8) Self {
// This should be rarely used, so this is fine. But if we add more of these
// options, move to using an init_opts struct, rather than this builder pattern.
var result = self;
result.for_field_name = field_name;
return result;
}