netlist

package
v0.0.0-...-967fbc8 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ipv6

type Ipv6 struct {
	// contains filtered or unexported fields
}

func (Ipv6) Put

func (ip Ipv6) Put(b []byte)

b must at least has length of 16.

func (Ipv6) String

func (ip Ipv6) String() string

func (Ipv6) ToAddr

func (ip Ipv6) ToAddr() netip.Addr

type List

type List[V any] struct {
	// contains filtered or unexported fields
}

func (*List[V]) Idx

func (l *List[V]) Idx(i int) (start, end Ipv6, v V)

Out of range idx will cause runtime panic

func (*List[V]) Len

func (l *List[V]) Len() int

func (*List[V]) Lookup

func (l *List[V]) Lookup(ip Ipv6) (_ V, ok bool)

func (*List[V]) LookupAddr

func (l *List[V]) LookupAddr(addr netip.Addr) (_ V, ok bool)

type ListBuilder

type ListBuilder[V any] struct {
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder[V any](initCap int) *ListBuilder[V]

func (*ListBuilder[V]) Add

func (b *ListBuilder[V]) Add(start, end netip.Addr, v V) (ok bool)

Add returns false if addrs are invalid. Or their range is invalid (start < end).

func (*ListBuilder[V]) Build

func (b *ListBuilder[V]) Build() (*List[V], error)

Build the list. If no error, the returned List will take the ownership of the builder memory. So, Build should only be called once.

Jump to

Keyboard shortcuts

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