Skeg.Command (skeg v1.0.0)

Copy Markdown

Builds the binary arguments of skeg commands.

Invalid input raises ArgumentError: a value that cannot be sent exactly is a bug in the caller, not a condition to retry.

Summary

Functions

A vector ID, from 0 to 2^64-1, as the decimal text the server expects. Floats are refused: above 2^53 they no longer hold every integer.

A vector as little-endian f32 bytes.

Functions

id(n)

@spec id(non_neg_integer()) :: binary()

A vector ID, from 0 to 2^64-1, as the decimal text the server expects. Floats are refused: above 2^53 they no longer hold every integer.

vector(packed)

@spec vector([number()] | binary()) :: binary()

A vector as little-endian f32 bytes.

Takes a list of numbers, or a binary already packed that way. Every component must be finite in f32: a number too large for f32 is refused rather than sent as infinity.