Skip to main content

NcType

Derive Macro NcType 

Source
#[derive(NcType)]
{
    // Attributes available to this derive:
    #[netcdf]
}
Available on crate feature derive only.
Expand description

Derives NcTypeDescriptor for user defined types.

See the documentation under netcdf::TypeDescriptor for examples

Use #[netcdf(rename = "name")] to rename field names or enum member names, or the name of the compound/enum.

Types one derives NcType for must have some properties to ensure correctness:

  • Structs must have repr(C) to ensure layout compatibility
  • Structs must be packed (no padding allowed)
  • Enums must have repr(T) where T is an int type ({i/u}{8/16/32/64})