widget

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2024 License: MIT Imports: 9 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetElem

func GetElem[U []E, E any](v ArrayValue[U, E]) *E

func Identity

func Identity[V any](v V) V

func MarshalBinary

func MarshalBinary[V any, W Widget[V]](v V, w W) ([]byte, error)

func MarshalJSON

func MarshalJSON[V any, W Widget[V]](v V, w W) ([]byte, error)

func UnmarshalBinary

func UnmarshalBinary[V any, W Widget[V]](v V, w W, b []byte) error

func UnmarshalJSON

func UnmarshalJSON[V any, W Widget[V]](v V, w W, b []byte) error

Types

type Array

type Array[V any, U []E, E any] struct {
	Get  func(V) *U
	Elem Widget[ArrayValue[U, E]]
}

func ForArray

func ForArray[V any, U []E, E any](
	elem Widget[ArrayValue[U, E]],
	get func(V) *U,
) *Array[V, U, E]

func (*Array[V, U, E]) CopyTo

func (a *Array[V, U, E]) CopyTo(dst, src V)

func (*Array[V, U, E]) Empty

func (a *Array[V, U, E]) Empty(v V) bool

func (*Array[V, U, E]) Equal

func (a *Array[V, U, E]) Equal(x, y V) bool

func (*Array[V, U, E]) IsNil

func (a *Array[V, U, E]) IsNil(v V) bool

func (*Array[V, U, E]) MarshalBinary

func (a *Array[V, U, E]) MarshalBinary(e *benc, v V) error

func (*Array[V, U, E]) MarshalJSON

func (a *Array[V, U, E]) MarshalJSON(e *jenc, v V) error

func (*Array[V, U, E]) UnmarshalBinary

func (a *Array[V, U, E]) UnmarshalBinary(d *bdec, v V) error

func (*Array[V, U, E]) UnmarshalJSON

func (a *Array[V, U, E]) UnmarshalJSON(d *jdec, v V) error

type ArrayValue

type ArrayValue[U []E, E any] struct {
	Array U
	Index int
}

type Bool

type Bool[V any] func(V) *bool

func ForBool

func ForBool[V any](f Bool[V]) Bool[V]

func (Bool[V]) CopyTo

func (f Bool[V]) CopyTo(dst, src V)

func (Bool[V]) Empty

func (f Bool[V]) Empty(v V) bool

func (Bool[V]) Equal

func (f Bool[V]) Equal(a, b V) bool

func (Bool[V]) IsNil

func (f Bool[V]) IsNil(v V) bool

func (Bool[V]) MarshalBinary

func (f Bool[V]) MarshalBinary(e *benc, v V) error

func (Bool[V]) MarshalJSON

func (f Bool[V]) MarshalJSON(e *jenc, v V) error

func (Bool[V]) UnmarshalBinary

func (f Bool[V]) UnmarshalBinary(d *bdec, v V) error

func (Bool[V]) UnmarshalJSON

func (f Bool[V]) UnmarshalJSON(d *jdec, v V) error

type BoolPtr

type BoolPtr[V any] func(V) **bool

func ForBoolPtr

func ForBoolPtr[V any](f BoolPtr[V]) BoolPtr[V]

func (BoolPtr[V]) CopyTo

func (f BoolPtr[V]) CopyTo(dst, src V)

func (BoolPtr[V]) Empty

func (f BoolPtr[V]) Empty(v V) bool

func (BoolPtr[V]) Equal

func (f BoolPtr[V]) Equal(a, b V) bool

func (BoolPtr[V]) IsNil

func (f BoolPtr[V]) IsNil(v V) bool

func (BoolPtr[V]) MarshalBinary

func (f BoolPtr[V]) MarshalBinary(e *benc, v V) error

func (BoolPtr[V]) MarshalJSON

func (f BoolPtr[V]) MarshalJSON(e *jenc, v V) error

func (BoolPtr[V]) UnmarshalBinary

func (f BoolPtr[V]) UnmarshalBinary(d *bdec, v V) error

func (BoolPtr[V]) UnmarshalJSON

func (f BoolPtr[V]) UnmarshalJSON(d *jdec, v V) error

type Bytes

type Bytes[V any] func(V) *[]byte

func ForBytes

func ForBytes[V any](f Bytes[V]) Bytes[V]

func (Bytes[V]) CopyTo

func (f Bytes[V]) CopyTo(dst, src V)

func (Bytes[V]) Empty

func (f Bytes[V]) Empty(v V) bool

func (Bytes[V]) Equal

func (f Bytes[V]) Equal(a, b V) bool

func (Bytes[V]) IsNil

func (f Bytes[V]) IsNil(v V) bool

func (Bytes[V]) MarshalBinary

func (f Bytes[V]) MarshalBinary(e *benc, v V) error

func (Bytes[V]) MarshalJSON

func (f Bytes[V]) MarshalJSON(e *jenc, v V) error

func (Bytes[V]) UnmarshalBinary

func (f Bytes[V]) UnmarshalBinary(d *bdec, v V) error

func (Bytes[V]) UnmarshalJSON

func (f Bytes[V]) UnmarshalJSON(d *jdec, v V) error

type Composite

type Composite[V, U any] struct {
	Get    func(V) *U
	Fields Fields[U]
}

func ForComposite

func ForComposite[V, U any](
	fields Fields[U],
	get func(V) *U,
) *Composite[V, U]

func (*Composite[V, U]) CopyTo

func (c *Composite[V, U]) CopyTo(dst, src V)

func (*Composite[V, U]) Empty

func (c *Composite[V, U]) Empty(v V) bool

func (*Composite[V, U]) Equal

func (c *Composite[V, U]) Equal(a, b V) bool

func (*Composite[V, U]) IsNil

func (c *Composite[V, U]) IsNil(v V) bool

func (*Composite[V, U]) MarshalBinary

func (c *Composite[V, U]) MarshalBinary(e *benc, v V) error

func (*Composite[V, U]) MarshalJSON

func (c *Composite[V, U]) MarshalJSON(e *jenc, v V) error

func (*Composite[V, U]) UnmarshalBinary

func (c *Composite[V, U]) UnmarshalBinary(d *bdec, v V) error

func (*Composite[V, U]) UnmarshalJSON

func (c *Composite[V, U]) UnmarshalJSON(d *jdec, v V) error

type CompositePtr

type CompositePtr[V, U any] struct {
	Get    func(V) **U
	Fields Fields[U]
}

func ForCompositePtr

func ForCompositePtr[V, U any](
	fields Fields[U],
	get func(V) **U,
) *CompositePtr[V, U]

func (*CompositePtr[V, U]) CopyTo

func (c *CompositePtr[V, U]) CopyTo(dst, src V)

func (*CompositePtr[V, U]) Empty

func (c *CompositePtr[V, U]) Empty(v V) bool

func (*CompositePtr[V, U]) Equal

func (c *CompositePtr[V, U]) Equal(a, b V) bool

func (*CompositePtr[V, U]) IsNil

func (c *CompositePtr[V, U]) IsNil(v V) bool

func (*CompositePtr[V, U]) MarshalBinary

func (c *CompositePtr[V, U]) MarshalBinary(e *benc, v V) error

func (*CompositePtr[V, U]) MarshalJSON

func (c *CompositePtr[V, U]) MarshalJSON(e *jenc, v V) error

func (*CompositePtr[V, U]) UnmarshalBinary

func (c *CompositePtr[V, U]) UnmarshalBinary(d *bdec, v V) error

func (*CompositePtr[V, U]) UnmarshalJSON

func (c *CompositePtr[V, U]) UnmarshalJSON(d *jdec, v V) error

type EncodableValue

type EncodableValue[V any] interface {
	comparable
	Copy() V
	Equal(V) bool
}

type Enum

type Enum[V any, E EnumValue[U], U EnumUnderlying] func(V) *U

func ForEnum

func ForEnum[E EnumValue[U], V any, U EnumUnderlying](
	f Enum[V, E, U],
) Enum[V, E, U]

func (Enum[V, E, U]) CopyTo

func (f Enum[V, E, U]) CopyTo(dst, src V)

func (Enum[V, E, U]) Empty

func (f Enum[V, E, U]) Empty(v V) bool

func (Enum[V, E, U]) Equal

func (f Enum[V, E, U]) Equal(a, b V) bool

func (Enum[V, E, U]) IsNil

func (f Enum[V, E, U]) IsNil(v V) bool

func (Enum[V, E, U]) MarshalBinary

func (f Enum[V, E, U]) MarshalBinary(e *benc, v V) error

func (Enum[V, E, U]) MarshalJSON

func (f Enum[V, E, U]) MarshalJSON(e *jenc, v V) error

func (Enum[V, E, U]) UnmarshalBinary

func (f Enum[V, E, U]) UnmarshalBinary(d *bdec, v V) error

func (Enum[V, E, U]) UnmarshalJSON

func (f Enum[V, E, U]) UnmarshalJSON(d *jdec, v V) error

type EnumPtr

type EnumPtr[V any, E EnumValue[U], U EnumUnderlying] func(V) **U

func ForEnumPtr

func ForEnumPtr[E EnumValue[U], V any, U EnumUnderlying](
	f EnumPtr[V, E, U],
) EnumPtr[V, E, U]

func (EnumPtr[V, E, U]) CopyTo

func (f EnumPtr[V, E, U]) CopyTo(dst, src V)

func (EnumPtr[V, E, U]) Empty

func (f EnumPtr[V, E, U]) Empty(v V) bool

func (EnumPtr[V, E, U]) Equal

func (f EnumPtr[V, E, U]) Equal(a, b V) bool

func (EnumPtr[V, E, U]) IsNil

func (f EnumPtr[V, E, U]) IsNil(v V) bool

func (EnumPtr[V, E, U]) MarshalBinary

func (f EnumPtr[V, E, U]) MarshalBinary(e *benc, v V) error

func (EnumPtr[V, E, U]) MarshalJSON

func (f EnumPtr[V, E, U]) MarshalJSON(e *jenc, v V) error

func (EnumPtr[V, E, U]) UnmarshalBinary

func (f EnumPtr[V, E, U]) UnmarshalBinary(d *bdec, v V) error

func (EnumPtr[V, E, U]) UnmarshalJSON

func (f EnumPtr[V, E, U]) UnmarshalJSON(d *jdec, v V) error

type EnumUnderlying

type EnumUnderlying = constraints.Integer

type EnumValue

type EnumValue[V any] interface {
	~*V
	String() string
	SetByValue(int64) bool
	SetByName(string) bool
}

type Field

type Field[V any] struct {
	Widget[V]
	Name      string
	ID        uint
	KeepEmpty bool
}

type Fields

type Fields[V any] []*Field[*V]

func (Fields[V]) CopyTo

func (c Fields[V]) CopyTo(dst, src *V)

func (Fields[V]) Empty

func (c Fields[V]) Empty(v *V) bool

func (Fields[V]) Equal

func (c Fields[V]) Equal(a, b *V) bool

func (Fields[V]) MarshalBinary

func (c Fields[V]) MarshalBinary(e *benc, v *V) error

func (Fields[V]) MarshalJSON

func (c Fields[V]) MarshalJSON(e *jenc, v *V) error

func (Fields[V]) UnmarshalBinary

func (c Fields[V]) UnmarshalBinary(d *bdec, v *V) error

func (Fields[V]) UnmarshalJSON

func (c Fields[V]) UnmarshalJSON(d *jdec, v *V) error

type Float

type Float[V any] func(V) *float64

func ForFloat

func ForFloat[V any](f Float[V]) Float[V]

func (Float[V]) CopyTo

func (f Float[V]) CopyTo(dst, src V)

func (Float[V]) Empty

func (f Float[V]) Empty(v V) bool

func (Float[V]) Equal

func (f Float[V]) Equal(a, b V) bool

func (Float[V]) IsNil

func (f Float[V]) IsNil(v V) bool

func (Float[V]) MarshalBinary

func (f Float[V]) MarshalBinary(e *benc, v V) error

func (Float[V]) MarshalJSON

func (f Float[V]) MarshalJSON(e *jenc, v V) error

func (Float[V]) UnmarshalBinary

func (f Float[V]) UnmarshalBinary(d *bdec, v V) error

func (Float[V]) UnmarshalJSON

func (f Float[V]) UnmarshalJSON(d *jdec, v V) error

type FloatPtr

type FloatPtr[V any] func(V) **float64

func ForFloatPtr

func ForFloatPtr[V any](f FloatPtr[V]) FloatPtr[V]

func (FloatPtr[V]) CopyTo

func (f FloatPtr[V]) CopyTo(dst, src V)

func (FloatPtr[V]) Empty

func (f FloatPtr[V]) Empty(v V) bool

func (FloatPtr[V]) Equal

func (f FloatPtr[V]) Equal(a, b V) bool

func (FloatPtr[V]) IsNil

func (f FloatPtr[V]) IsNil(v V) bool

func (FloatPtr[V]) MarshalBinary

func (f FloatPtr[V]) MarshalBinary(e *benc, v V) error

func (FloatPtr[V]) MarshalJSON

func (f FloatPtr[V]) MarshalJSON(e *jenc, v V) error

func (FloatPtr[V]) UnmarshalBinary

func (f FloatPtr[V]) UnmarshalBinary(d *bdec, v V) error

func (FloatPtr[V]) UnmarshalJSON

func (f FloatPtr[V]) UnmarshalJSON(d *jdec, v V) error

type Hash

type Hash[V any] func(V) *[32]byte

func ForHash

func ForHash[V any](f Hash[V]) Hash[V]

func (Hash[V]) CopyTo

func (f Hash[V]) CopyTo(dst, src V)

func (Hash[V]) Empty

func (f Hash[V]) Empty(v V) bool

func (Hash[V]) Equal

func (f Hash[V]) Equal(a, b V) bool

func (Hash[V]) IsNil

func (f Hash[V]) IsNil(v V) bool

func (Hash[V]) MarshalBinary

func (f Hash[V]) MarshalBinary(e *benc, v V) error

func (Hash[V]) MarshalJSON

func (f Hash[V]) MarshalJSON(e *jenc, v V) error

func (Hash[V]) UnmarshalBinary

func (f Hash[V]) UnmarshalBinary(d *bdec, v V) error

func (Hash[V]) UnmarshalJSON

func (f Hash[V]) UnmarshalJSON(d *jdec, v V) error

type HashPtr

type HashPtr[V any] func(V) **[32]byte

func ForHashPtr

func ForHashPtr[V any](f HashPtr[V]) HashPtr[V]

func (HashPtr[V]) CopyTo

func (f HashPtr[V]) CopyTo(dst, src V)

func (HashPtr[V]) Empty

func (f HashPtr[V]) Empty(v V) bool

func (HashPtr[V]) Equal

func (f HashPtr[V]) Equal(a, b V) bool

func (HashPtr[V]) IsNil

func (f HashPtr[V]) IsNil(v V) bool

func (HashPtr[V]) MarshalBinary

func (f HashPtr[V]) MarshalBinary(e *benc, v V) error

func (HashPtr[V]) MarshalJSON

func (f HashPtr[V]) MarshalJSON(e *jenc, v V) error

func (HashPtr[V]) UnmarshalBinary

func (f HashPtr[V]) UnmarshalBinary(d *bdec, v V) error

func (HashPtr[V]) UnmarshalJSON

func (f HashPtr[V]) UnmarshalJSON(d *jdec, v V) error

type Int

type Int[V any] func(V) *int64

func ForInt

func ForInt[V any](f Int[V]) Int[V]

func (Int[V]) CopyTo

func (f Int[V]) CopyTo(dst, src V)

func (Int[V]) Empty

func (f Int[V]) Empty(v V) bool

func (Int[V]) Equal

func (f Int[V]) Equal(a, b V) bool

func (Int[V]) IsNil

func (f Int[V]) IsNil(v V) bool

func (Int[V]) MarshalBinary

func (f Int[V]) MarshalBinary(e *benc, v V) error

func (Int[V]) MarshalJSON

func (f Int[V]) MarshalJSON(e *jenc, v V) error

func (Int[V]) UnmarshalBinary

func (f Int[V]) UnmarshalBinary(d *bdec, v V) error

func (Int[V]) UnmarshalJSON

func (f Int[V]) UnmarshalJSON(d *jdec, v V) error

type IntPtr

type IntPtr[V any] func(V) **int64

func ForIntPtr

func ForIntPtr[V any](f IntPtr[V]) IntPtr[V]

func (IntPtr[V]) CopyTo

func (f IntPtr[V]) CopyTo(dst, src V)

func (IntPtr[V]) Empty

func (f IntPtr[V]) Empty(v V) bool

func (IntPtr[V]) Equal

func (f IntPtr[V]) Equal(a, b V) bool

func (IntPtr[V]) IsNil

func (f IntPtr[V]) IsNil(v V) bool

func (IntPtr[V]) MarshalBinary

func (f IntPtr[V]) MarshalBinary(e *benc, v V) error

func (IntPtr[V]) MarshalJSON

func (f IntPtr[V]) MarshalJSON(e *jenc, v V) error

func (IntPtr[V]) UnmarshalBinary

func (f IntPtr[V]) UnmarshalBinary(d *bdec, v V) error

func (IntPtr[V]) UnmarshalJSON

func (f IntPtr[V]) UnmarshalJSON(d *jdec, v V) error

type String

type String[V any] func(V) *string

func ForString

func ForString[V any](f String[V]) String[V]

func (String[V]) CopyTo

func (f String[V]) CopyTo(dst, src V)

func (String[V]) Empty

func (f String[V]) Empty(v V) bool

func (String[V]) Equal

func (f String[V]) Equal(a, b V) bool

func (String[V]) IsNil

func (f String[V]) IsNil(v V) bool

func (String[V]) MarshalBinary

func (f String[V]) MarshalBinary(e *benc, v V) error

func (String[V]) MarshalJSON

func (f String[V]) MarshalJSON(e *jenc, v V) error

func (String[V]) UnmarshalBinary

func (f String[V]) UnmarshalBinary(d *bdec, v V) error

func (String[V]) UnmarshalJSON

func (f String[V]) UnmarshalJSON(d *jdec, v V) error

type StringPtr

type StringPtr[V any] func(V) **string

func ForStringPtr

func ForStringPtr[V any](f StringPtr[V]) StringPtr[V]

func (StringPtr[V]) CopyTo

func (f StringPtr[V]) CopyTo(dst, src V)

func (StringPtr[V]) Empty

func (f StringPtr[V]) Empty(v V) bool

func (StringPtr[V]) Equal

func (f StringPtr[V]) Equal(a, b V) bool

func (StringPtr[V]) IsNil

func (f StringPtr[V]) IsNil(v V) bool

func (StringPtr[V]) MarshalBinary

func (f StringPtr[V]) MarshalBinary(e *benc, v V) error

func (StringPtr[V]) MarshalJSON

func (f StringPtr[V]) MarshalJSON(e *jenc, v V) error

func (StringPtr[V]) UnmarshalBinary

func (f StringPtr[V]) UnmarshalBinary(d *bdec, v V) error

func (StringPtr[V]) UnmarshalJSON

func (f StringPtr[V]) UnmarshalJSON(d *jdec, v V) error

type Uint

type Uint[V any] func(V) *uint64

func ForUint

func ForUint[V any](f Uint[V]) Uint[V]

func (Uint[V]) CopyTo

func (f Uint[V]) CopyTo(dst, src V)

func (Uint[V]) Empty

func (f Uint[V]) Empty(v V) bool

func (Uint[V]) Equal

func (f Uint[V]) Equal(a, b V) bool

func (Uint[V]) IsNil

func (f Uint[V]) IsNil(v V) bool

func (Uint[V]) MarshalBinary

func (f Uint[V]) MarshalBinary(e *benc, v V) error

func (Uint[V]) MarshalJSON

func (f Uint[V]) MarshalJSON(e *jenc, v V) error

func (Uint[V]) UnmarshalBinary

func (f Uint[V]) UnmarshalBinary(d *bdec, v V) error

func (Uint[V]) UnmarshalJSON

func (f Uint[V]) UnmarshalJSON(d *jdec, v V) error

type UintPtr

type UintPtr[V any] func(V) **uint64

func ForUintPtr

func ForUintPtr[V any](f UintPtr[V]) UintPtr[V]

func (UintPtr[V]) CopyTo

func (f UintPtr[V]) CopyTo(dst, src V)

func (UintPtr[V]) Empty

func (f UintPtr[V]) Empty(v V) bool

func (UintPtr[V]) Equal

func (f UintPtr[V]) Equal(a, b V) bool

func (UintPtr[V]) IsNil

func (f UintPtr[V]) IsNil(v V) bool

func (UintPtr[V]) MarshalBinary

func (f UintPtr[V]) MarshalBinary(e *benc, v V) error

func (UintPtr[V]) MarshalJSON

func (f UintPtr[V]) MarshalJSON(e *jenc, v V) error

func (UintPtr[V]) UnmarshalBinary

func (f UintPtr[V]) UnmarshalBinary(d *bdec, v V) error

func (UintPtr[V]) UnmarshalJSON

func (f UintPtr[V]) UnmarshalJSON(d *jdec, v V) error

type Union

type Union[V any, U comparable, EV EnumValue[EU], EU EnumUnderlying] struct {
	Get     func(V) *U
	Tag     UnionTag[U, EV, EU]
	Members map[EU]UnionMemberFields[U]
}

func ForUnion

func ForUnion[EV EnumValue[EU], EU EnumUnderlying, V any, U comparable](
	tagName string,
	getTag func(U) EU,
	members map[EU]UnionMemberFields[U],
	get func(V) *U,
) *Union[V, U, EV, EU]

func (*Union[V, U, EV, EU]) CopyTo

func (n *Union[V, U, EV, EU]) CopyTo(dst, src V)

func (*Union[V, U, EV, EU]) Empty

func (n *Union[V, U, EV, EU]) Empty(v V) bool

func (*Union[V, U, EV, EU]) Equal

func (n *Union[V, U, EV, EU]) Equal(a, b V) bool

func (*Union[V, U, EV, EU]) IsNil

func (n *Union[V, U, EV, EU]) IsNil(v V) bool

func (*Union[V, U, EV, EU]) MarshalBinary

func (n *Union[V, U, EV, EU]) MarshalBinary(e *benc, v V) error

func (*Union[V, U, EV, EU]) MarshalJSON

func (n *Union[V, U, EV, EU]) MarshalJSON(e *jenc, v V) error

func (*Union[V, U, EV, EU]) UnmarshalBinary

func (n *Union[V, U, EV, EU]) UnmarshalBinary(d *bdec, v V) error

func (*Union[V, U, EV, EU]) UnmarshalJSON

func (n *Union[V, U, EV, EU]) UnmarshalJSON(d *jdec, v V) error

type UnionMember

type UnionMember[U comparable, M any] struct {
	Fields Fields[M]
}

func (*UnionMember[U, M]) CopyTo

func (um *UnionMember[U, M]) CopyTo(dst, src *U)

func (*UnionMember[U, M]) Empty

func (um *UnionMember[U, M]) Empty(u *U) bool

func (*UnionMember[U, M]) Equal

func (um *UnionMember[U, M]) Equal(a, b *U) bool

func (*UnionMember[U, M]) IsNil

func (um *UnionMember[U, M]) IsNil(u *U) bool

func (*UnionMember[U, M]) MarshalBinary

func (um *UnionMember[U, M]) MarshalBinary(e *benc, u *U) error

func (*UnionMember[U, M]) MarshalJSON

func (um *UnionMember[U, M]) MarshalJSON(e *jenc, u *U) error

func (*UnionMember[U, M]) New

func (um *UnionMember[U, M]) New() U

func (*UnionMember[U, M]) UnmarshalBinary

func (um *UnionMember[U, M]) UnmarshalBinary(d *bdec, u *U) error

func (*UnionMember[U, M]) UnmarshalJSON

func (um *UnionMember[U, M]) UnmarshalJSON(d *jdec, u *U) error

type UnionMemberFields

type UnionMemberFields[U any] interface {
	New() U
	Widget[*U]
}

type UnionTag

type UnionTag[U any, EV EnumValue[EU], EU EnumUnderlying] struct {
	Name string
	Get  func(U) EU
}

func ForTag

func ForTag[EV EnumValue[EU], EU EnumUnderlying, V any](
	tagName string,
	get func(V) EU,
) *UnionTag[V, EV, EU]

func (*UnionTag[U, EV, EU]) CopyTo

func (ut *UnionTag[U, EV, EU]) CopyTo(U, U)

func (*UnionTag[U, EV, EU]) Empty

func (ut *UnionTag[U, EV, EU]) Empty(U) bool

func (*UnionTag[U, EV, EU]) Equal

func (ut *UnionTag[U, EV, EU]) Equal(a, b U) bool

func (*UnionTag[U, EV, EU]) IsNil

func (ut *UnionTag[U, EV, EU]) IsNil(U) bool

func (*UnionTag[U, EV, EU]) MarshalBinary

func (ut *UnionTag[U, EV, EU]) MarshalBinary(e *benc, u U) error

func (*UnionTag[U, EV, EU]) MarshalJSON

func (ut *UnionTag[U, EV, EU]) MarshalJSON(e *jenc, u U) error

func (*UnionTag[U, EV, EU]) UnmarshalBinary

func (ut *UnionTag[U, EV, EU]) UnmarshalBinary(d *bdec, u U) error

func (*UnionTag[U, EV, EU]) UnmarshalJSON

func (ut *UnionTag[U, EV, EU]) UnmarshalJSON(d *jdec, u U) error

type Value

type Value[V any, U EncodableValue[U]] func(V) *U

func ForValue

func ForValue[V any, U EncodableValue[U]](f Value[V, U]) Value[V, U]

func (Value[V, U]) CopyTo

func (f Value[V, U]) CopyTo(dst, src V)

func (Value[V, U]) Empty

func (f Value[V, U]) Empty(v V) bool

func (Value[V, U]) Equal

func (f Value[V, U]) Equal(a, b V) bool

func (Value[V, U]) IsNil

func (f Value[V, U]) IsNil(v V) bool

func (Value[V, U]) MarshalBinary

func (f Value[V, U]) MarshalBinary(e *benc, v V) error

func (Value[V, U]) MarshalJSON

func (f Value[V, U]) MarshalJSON(e *jenc, v V) error

func (Value[V, U]) UnmarshalBinary

func (f Value[V, U]) UnmarshalBinary(d *bdec, v V) error

func (Value[V, U]) UnmarshalJSON

func (f Value[V, U]) UnmarshalJSON(d *jdec, v V) error

type Widget

type Widget[V any] interface {
	IsNil(v V) bool
	Empty(v V) bool
	CopyTo(dst, src V)
	Equal(a, b V) bool
	MarshalJSON(e *jenc, v V) error
	UnmarshalJSON(d *jdec, v V) error
	MarshalBinary(e *benc, v V) error
	UnmarshalBinary(d *bdec, v V) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL