Documentation ¶
Index ¶
- type BitField
- func (bf BitField) All(val bool) bool
- func (bf BitField) Clear(idx uint32)
- func (bf BitField) CountSet() (ret uint32)
- func (bf *BitField) FromProperty(p datastore.Property) error
- func (bf BitField) IsSet(idx uint32) bool
- func (bf *BitField) MarshalBinary() ([]byte, error)
- func (bf *BitField) Reset()
- func (bf BitField) Set(idx uint32)
- func (bf BitField) Size() uint32
- func (bf *BitField) ToProperty() (datastore.Property, error)
- func (bf *BitField) UnmarshalBinary(bs []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type 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.
func (BitField) All ¶
All returns true iff all of the bits are equal to `val`.
func (BitField) Clear ¶
Clear turns the given bit to false, regardless of its previous value. Will panic if idx >= Size().
func (BitField) CountSet ¶
CountSet returns the number of true bits.
func (*BitField) FromProperty ¶
FromProperty implements datastore.PropertyConverter
func (BitField) IsSet ¶
IsSet returns the value of a given bit.
func (*BitField) MarshalBinary ¶
MarshalBinary implements encoding.BinaryMarshaller
func (*BitField) Reset ¶
func (bf *BitField) Reset()
Reset resets this BitField to the 'empty' (size-0) state.
func (BitField) Set ¶
Set turns the given bit to true, regardless of its previous value. Will panic if idx >= Size().
func (BitField) Size ¶
Size returns the number of bits which this BitField can hold.
func (*BitField) ToProperty ¶
ToProperty implements datastore.PropertyConverter