pub struct FlatOpStreamDesc {
pub name: &'static str,
pub kind_name: &'static str,
pub max_ops_const_name: &'static str,
pub max_ops: u32,
pub header: &'static [FlatOpFieldDesc],
pub scope: Option<FlatOpScopeDesc>,
pub ops: &'static [FlatOpDesc],
}Expand description
Derives NvEncode and NvDecode for Tier-2 little-endian structs and enums.
§Compile-Time Guards
Generics are rejected:
use nativeview_codec::NvCodec;
#[derive(NvCodec)]
struct BadGeneric<T: nativeview_codec::NvEncode + nativeview_codec::NvDecode>(T);where clauses are rejected:
use nativeview_codec::NvCodec;
#[derive(NvCodec)]
struct BadWhere(u8) where u8: Copy;Field-level #[nativeview_codec(...)] attributes are rejected:
use nativeview_codec::NvCodec;
#[derive(NvCodec)]
struct BadFieldAttr {
#[nativeview_codec(skip)]
a: u8,
}Conflicting #[nativeview_codec(tag = ...)] and = discriminant are rejected:
use nativeview_codec::NvCodec;
#[repr(u8)]
#[derive(NvCodec)]
enum ConflictingTag {
#[nativeview_codec(tag = 1)]
A(u8) = 2,
}Duplicate enum tags are rejected:
use nativeview_codec::NvCodec;
#[derive(NvCodec)]
enum DupTag {
#[nativeview_codec(tag = 1)]
A(u8),
#[nativeview_codec(tag = 1)]
B(u16),
}Out-of-range tags are rejected:
use nativeview_codec::NvCodec;
#[derive(NvCodec)]
enum OutOfRange {
#[nativeview_codec(tag = 256)]
TooBig(u8),
}Non-u8 data-carrying enums are rejected:
use nativeview_codec::NvCodec;
#[repr(u16)]
#[derive(NvCodec)]
enum BadDataRepr {
A(u32),
}Unknown #[nativeview_codec(...)] keys are rejected:
use nativeview_codec::NvCodec;
#[derive(NvCodec)]
#[nativeview_codec(unknown_key = "x")]
struct BadKey(u8);Unit-only enums must use Rust discriminants instead of #[nativeview_codec(tag = ...)]:
use nativeview_codec::NvCodec;
#[repr(u8)]
#[derive(NvCodec)]
enum BadUnitTag {
#[nativeview_codec(tag = 7)]
A,
}Unsupported integer #[repr(...)] attributes are rejected:
use nativeview_codec::NvCodec;
#[repr(i8)]
#[derive(NvCodec)]
enum BadRepr {
A = 1,
}Derives NvEncode and NvDecode for Tier-2 little-endian structs and enums.
§Compile-Time Guards
Generics are rejected:
use nativeview_codec::NvCodec;
#[derive(NvCodec)]
struct BadGeneric<T: nativeview_codec::NvEncode + nativeview_codec::NvDecode>(T);where clauses are rejected:
use nativeview_codec::NvCodec;
#[derive(NvCodec)]
struct BadWhere(u8) where u8: Copy;Field-level #[nativeview_codec(...)] attributes are rejected:
use nativeview_codec::NvCodec;
#[derive(NvCodec)]
struct BadFieldAttr {
#[nativeview_codec(skip)]
a: u8,
}Conflicting #[nativeview_codec(tag = ...)] and = discriminant are rejected:
use nativeview_codec::NvCodec;
#[repr(u8)]
#[derive(NvCodec)]
enum ConflictingTag {
#[nativeview_codec(tag = 1)]
A(u8) = 2,
}Duplicate enum tags are rejected:
use nativeview_codec::NvCodec;
#[derive(NvCodec)]
enum DupTag {
#[nativeview_codec(tag = 1)]
A(u8),
#[nativeview_codec(tag = 1)]
B(u16),
}Out-of-range tags are rejected:
use nativeview_codec::NvCodec;
#[derive(NvCodec)]
enum OutOfRange {
#[nativeview_codec(tag = 256)]
TooBig(u8),
}Non-u8 data-carrying enums are rejected:
use nativeview_codec::NvCodec;
#[repr(u16)]
#[derive(NvCodec)]
enum BadDataRepr {
A(u32),
}Unknown #[nativeview_codec(...)] keys are rejected:
use nativeview_codec::NvCodec;
#[derive(NvCodec)]
#[nativeview_codec(unknown_key = "x")]
struct BadKey(u8);Unit-only enums must use Rust discriminants instead of #[nativeview_codec(tag = ...)]:
use nativeview_codec::NvCodec;
#[repr(u8)]
#[derive(NvCodec)]
enum BadUnitTag {
#[nativeview_codec(tag = 7)]
A,
}Unsupported integer #[repr(...)] attributes are rejected:
use nativeview_codec::NvCodec;
#[repr(i8)]
#[derive(NvCodec)]
enum BadRepr {
A = 1,
}Derives NvEncode and NvDecode for Tier-2 little-endian structs and enums.
§Compile-Time Guards
Generics are rejected:
use nativeview_codec::NvCodec;
#[derive(NvCodec)]
struct BadGeneric<T: nativeview_codec::NvEncode + nativeview_codec::NvDecode>(T);where clauses are rejected:
use nativeview_codec::NvCodec;
#[derive(NvCodec)]
struct BadWhere(u8) where u8: Copy;Field-level #[nativeview_codec(...)] attributes are rejected:
use nativeview_codec::NvCodec;
#[derive(NvCodec)]
struct BadFieldAttr {
#[nativeview_codec(skip)]
a: u8,
}Conflicting #[nativeview_codec(tag = ...)] and = discriminant are rejected:
use nativeview_codec::NvCodec;
#[repr(u8)]
#[derive(NvCodec)]
enum ConflictingTag {
#[nativeview_codec(tag = 1)]
A(u8) = 2,
}Duplicate enum tags are rejected:
use nativeview_codec::NvCodec;
#[derive(NvCodec)]
enum DupTag {
#[nativeview_codec(tag = 1)]
A(u8),
#[nativeview_codec(tag = 1)]
B(u16),
}Out-of-range tags are rejected:
use nativeview_codec::NvCodec;
#[derive(NvCodec)]
enum OutOfRange {
#[nativeview_codec(tag = 256)]
TooBig(u8),
}Non-u8 data-carrying enums are rejected:
use nativeview_codec::NvCodec;
#[repr(u16)]
#[derive(NvCodec)]
enum BadDataRepr {
A(u32),
}Unknown #[nativeview_codec(...)] keys are rejected:
use nativeview_codec::NvCodec;
#[derive(NvCodec)]
#[nativeview_codec(unknown_key = "x")]
struct BadKey(u8);Unit-only enums must use Rust discriminants instead of #[nativeview_codec(tag = ...)]:
use nativeview_codec::NvCodec;
#[repr(u8)]
#[derive(NvCodec)]
enum BadUnitTag {
#[nativeview_codec(tag = 7)]
A,
}Unsupported integer #[repr(...)] attributes are rejected:
use nativeview_codec::NvCodec;
#[repr(i8)]
#[derive(NvCodec)]
enum BadRepr {
A = 1,
}Complete schema descriptor for one flat 4-byte-aligned word-op stream resource.
Fields§
§name: &'static strPascalCase stream name (e.g. "DrawList" -> NvDrawList / nv_draw_list).
kind_name: &'static strCanonical resource kind string hashed via XXH64 (Key64::of(kind_name)).
max_ops_const_name: &'static strConstant identifier for the op-count upper bound (e.g. "MAX_DRAW_OPS").
max_ops: u32Strict upper bound on operations per stream.
header: &'static [FlatOpFieldDesc]Fixed scalar fields (no FlatOpFieldType::Point2Slice) following op_count, delivered to
sinks once before the first operation (empty for plain op streams).
scope: Option<FlatOpScopeDesc>Optional balanced push/pop scope pair.
ops: &'static [FlatOpDesc]All valid operation variants in canonical wire order.