blob: 2093005b5a98ed11ae2f180087a4e4d1375eb014 [file] [log] [blame]
// Code generated by fidlgen; DO NOT EDIT.
package bitsconstants
import (
_bindings "syscall/zx/fidl"
)
const (
Const1 BitsType = BitsTypeA
Const2 BitsType = 129
Const3 BitsType = 131
)
var _ _bindings.Bits = BitsType(0)
type BitsType uint32
const (
BitsTypeA BitsType = 1
BitsTypeB BitsType = 128
BitsTypeC BitsType = 2
BitsType_Mask BitsType = 131
)
func (_ BitsType) I_BitsMask() BitsType {
return BitsType_Mask
}
func (_ BitsType) I_BitsIsStrict() bool {
return true
}
func (x BitsType) HasUnknownBits() bool {
return x.GetUnknownBits() != 0
}
func (x BitsType) GetUnknownBits() uint64 {
return uint64(^BitsType_Mask & x)
}
func (x BitsType) InvertBits() BitsType {
return BitsType_Mask & ^x
}
// HasBits validates that all flipped bits in the mask are set.
func (x BitsType) HasBits(mask BitsType) bool {
return mask|x == x
}
// ClearBits ensures all flipped bits in the mask are unset.
func (x BitsType) ClearBits(mask BitsType) BitsType {
return ^mask & x
}
func (x BitsType) String() string {
switch x {
case 1:
return "A"
case 128:
return "B"
case 2:
return "C"
}
return "Unknown"
}