import "go.chromium.org/luci/tumble/bitfield"
type BitField struct {
// contains filtered or unexported fields
}
BitField is a luci/gae-serializable bit field implementation. It should be nice and fast for non-AppEngine use as well.
You should construct a new one with bf.Make, rather than by direct construction.
Make creates a new BitField.
All returns true iff all of the bits are equal to `val`.
Clear turns the given bit to false, regardless of its previous value. Will panic if idx >= Size().
CountSet returns the number of true bits.
FromProperty implements datastore.PropertyConverter
IsSet returns the value of a given bit.
MarshalBinary implements encoding.BinaryMarshaller
Reset resets this BitField to the 'empty' (size-0) state.
Set turns the given bit to true, regardless of its previous value. Will panic if idx >= Size().
Size returns the number of bits which this BitField can hold.
ToProperty implements datastore.PropertyConverter
UnmarshalBinary implements encoding.BinaryUnmarshaler
Path | Synopsis |
---|---|
tool |
Package bitfield imports 6 packages (graph) and is imported by 4 packages. Updated 2021-01-20. Refresh now. Tools for package owners.