Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ref ¶
type Ref[T any] struct { // contains filtered or unexported fields }
Ref is a generic struct that holds concurrent read and write objects to allow for safe concurrent read access with minimal locking, and atomic updates to the write object.
func (*Ref[T]) MarshalJSON ¶
MarshalJSON returns the JSON encoding of the read object.
func (*Ref[T]) Replace ¶
func (rw *Ref[T]) Replace(new *T) (old *T)
Replace replaces the ref and returns the old ref
func (*Ref[T]) UnmarshalJSON ¶
UnmarshalJSON decodes the JSON data and updates the write object.
Click to show internal directories.
Click to hide internal directories.