Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var IncompatibleTypes = errors.New("incompatible types")
View Source
var Overflow = errors.New("integer overflow: uint64 value too large for int64")
Functions ¶
func ToDuration ¶
ToDuration attempts to convert a value to a duration. Int and Double are converted as seconds. The resulting coerced value is written to out, and true is returned. If the value cannot be coerced, then false is returned.
Types ¶
type Pair ¶
type Pair struct { // a and b point to inputs that can't change A zcode.Bytes B zcode.Bytes // Buffer is a scratch buffer that stays around between calls and is the // landing place for either the a or b value if one of them needs to // be coerced (you never need to coerce both). Then we point a or b // at buf and let go of the other input pointer. result.Buffer // contains filtered or unexported fields }
Pair provides a buffer to decode values into while doing comparisons so the same buffers can be reused on each call without zcode.Bytes buffers escaping to GC. This method uses the zed.AppendInt(), zed.AppendUint(), etc to encode zcode.Bytes as an in-place slice instead of allocating new slice buffers for every value created.
Click to show internal directories.
Click to hide internal directories.