2023-07-09 11:39:35 +03:00
|
|
|
package iterx
|
|
|
|
|
|
|
|
// Implementing the interface lets us iterate through the
|
|
|
|
// the data by lightweight channels.
|
2023-08-27 15:41:30 +03:00
|
|
|
type Channeler[V any] interface {
|
|
|
|
Chan() chan V
|
2023-07-09 11:39:35 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// Implementing the interface provides the way to
|
|
|
|
// convert the type to slice.
|
|
|
|
type Slicer[V any] interface {
|
|
|
|
Slice() []V
|
|
|
|
}
|
|
|
|
|
|
|
|
// Implementing the interface provides us the way to
|
|
|
|
// convert the type to map.
|
|
|
|
type Mapper[K comparable, V any] interface {
|
|
|
|
Map() map[K] V
|
|
|
|
}
|
|
|
|
|