Skip to main content

Crate nsi_trait

Crate nsi_trait 

Source
Expand description

Core traits and types for the Nodal Scene Interface – ɴsɪ.

This crate provides the fundamental abstractions for ɴsɪ without any FFI dependencies. It defines:

  • Nsi – the core trait that rendering contexts implement (self is the context)
  • ParamValue – trait implemented by Rust values that can be expressed as a single ɴsɪ NSIParam_t at the FFI boundary
  • Attribute<T> and its alias Parameter<T> – typed compile-time names
  • Type – NSI data type discriminant (#[repr(i32)], C-compatible)
  • FfiParam – C-compatible parameter struct (#[repr(C)])
  • Flags – Parameter flags (PerFace, PerVertex, etc.)
  • Name – Feature-gated string type (ustr::Ustr or String)
  • Action – Render control actions
  • NodeType – Enum of all standard node types
  • Node type constants (ROOT, MESH, etc.)
  • Attribute<T> – Typed attribute names with per-name compile-time data-shape verification, plus standard attribute constants (P, FOV, etc.)

§Crate Organization

This is a pure Rust crate with no FFI. For FFI wrapper functionality, see the nsi-ffi-wrap crate.

Re-exports§

pub use attribute::*;
pub use node::*;

Modules§

attribute
Typed attribute / parameter names — compile-time witnesses for ɴsɪ NSIParam_t identifiers.
node
Standard ɴsɪ node types and constants.

Structs§

FfiParam
C-compatible parameter struct, layout-identical to NSIParam_t.
Flags
Parameter flags matching the C API constants.

Enums§

Action
Actions for render control.
Type
NSI data type discriminant, binary-compatible with NSIType_t from nsi.h.

Traits§

Nsi
Core ɴsɪ interface trait.
ParamValue
A single ɴsɪ parameter (name + typed data).

Type Aliases§

Name
Interned string type when the ustr feature is enabled, otherwise String.