Documentation ¶
Index ¶
- type Ring
- func (r *Ring[T]) Do(f func(v T, hasValue bool))
- func (r *Ring[T]) Get() (v T, ok bool)
- func (r *Ring[T]) Len() int
- func (r *Ring[T]) Link(s *Ring[T]) *Ring[T]
- func (r *Ring[T]) Move(n int) *Ring[T]
- func (r *Ring[T]) Next() *Ring[T]
- func (r *Ring[T]) Prev() *Ring[T]
- func (r *Ring[T]) Set(v T) *Ring[T]
- func (r *Ring[T]) Unlink(n int) *Ring[T]
- func (r *Ring[T]) Unwrap() *ring.Ring
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ring ¶
type Ring[T any] struct { // contains filtered or unexported fields }
func (*Ring[T]) Do ¶
Do is equivalent of `container/ring`.Do but added hasValue boolean. hasValue is false if internal Value is nil, indicating passed value is zero of T. hasValue is true othrewize.
func (*Ring[T]) Get ¶
Get returns internal Value. If internal Value is non-nil and then returns value and true. Otherwise returns zero of T and false.
Click to show internal directories.
Click to hide internal directories.