On Wed Oct 7, 2026 at 3:30 PM JST, Alexandre Courbot wrote:
> On Mon Sep 28, 2026 at 5:42 PM JST, Eliot Courtney wrote:
> <...>
>> + // Tests that encoding via the `nvkv_encode!` macro works correctly.
>> + #[test]
>> + fn encode_typed_struct() -> Result {
>> + const U32_KEY: KeyId = 0x0001;
>> + const U64_KEY: KeyId = 0x0002;
>> + const NAME_KEY: KeyId = 0x0003;
>> + const FIXED_KEY: KeyId = 0x0004;
>> + const OPT_KEY: KeyId = 0x0005;
>> + const INDEXED_KEY: KeyId = 0x0006;
>> +
>> + nvkv_encode! {
>> + struct TypedRequest {
>> + a: Key<u32, U32_KEY>,
>> + b: Key<u64, U64_KEY>,
>> + name: Key<&'static [u8], NAME_KEY>,
>> + fixed: Key<[u8; 4], FIXED_KEY>,
>> + opt: Option<Key<u32, OPT_KEY>>,
>> + indexed: IndexedKey<u32, INDEXED_KEY>,
>
> API question: `IndexedKey` is module-private, but this use of
> `nvkv_encode` looks like something that driver code could very well do.
> Should it be crate-visible? If so, why not move it next to `Key` in
> `nvkv.rs`?
It's not used immediately, but I think it's fine for it to be crate
visible since it is fair game to use it.