Documentation
¶
Overview ¶
Package zc provides helpers for working with zero-copy ranges.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExtractFrom ¶
type ExtractFrom struct {
Src *byte
}
ExtractFrom is a helper for creating extraction funcs. It exists to work around an inliner limitation.
func (ExtractFrom) Bytes ¶
func (e ExtractFrom) Bytes(raw uint64) []byte
ExtractBytes returns a func that calls Range.Bytes.
This exists to work around inlining failure in certain places in the parser.
type Range ¶
type Range uint64
Range is a representation of a []byte as a slice relative to some larger byte array, such as the source of a parsed message.
This is a packed representation of a value with the layout
struct { offset, len uint32 }
The zero value faithfully represents an empty slice.
func (Range) Bytes ¶
Bytes converts this Range into a byte slice, given its source.
NOTE: Go refuses to inline this function sometimes. Range.String does not appear to have this problem.
func (Range) Format ¶
Format implements fmt.Formatter.