pub struct Key(/* private fields */);Expand description
A key tuple: the value of one row’s key columns, or a prefix of them.
A key is a list of YSON values, compared component-wise — the same
[]any the Go SDK’s ypath.Key(values …any) takes. Single-component keys
convert from the value itself; a composite or mixed-type key is spelled
with yson_build:
let host = Key::from("example.com");
let host_and_code = Key::new([yson_build::string("example.com"), yson_build::int(404)]);
let visit = Key::new([yson_build::uint(1_700_000_000)]);The From shortcuts cover the types a key column usually has. From<i64>
sends an int64, and on a uint64 key column that is not a mismatch —
measured on a uint64-keyed table, {exact={key=[42]}} and
{exact={key=[42u]}} both returned the same row, so the cluster reads the
two as one key. What i64 cannot do is reach the top of that column:
every key above i64::MAX is unnameable by it, and only
yson_build::uint gets there —
{exact={key=[18446744073709551615u]}} returned its row. That ceiling is
why the helper exists.