Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateFlags ¶
func ValidateFlags(enabled bool)
ValidateFlags will panic when flag values are not on bit boundaries when enabled.
Types ¶
type Set ¶
type Set[T constraints.Unsigned] struct { // contains filtered or unexported fields }
Set is a helper for operating over a custom bit flag
The zero value is ready to use
func NewSet ¶
func NewSet[T constraints.Unsigned](flag T, extra ...T) Set[T]
NewSet returns a set with the provided flags set
func (*Set[T]) Add ¶
func (f *Set[T]) Add(flag T, extra ...T)
Add one or more flags to the set
Panics if any value is not on a bit-boundary to protect against misuse.
func (*Set[T]) Clear ¶
func (f *Set[T]) Clear(flag T, extra ...T)
Clear one or more flags from the set
Panics if any value is not on a bit-boundary to protect against misuse.
func (Set[T]) Has ¶
Has the flag been set?
Panics if any value is not on a bit-boundary to protect against misuse.
Click to show internal directories.
Click to hide internal directories.