pub struct HybridStructSpec {
pub name: String,
pub fields: Vec<HybridFieldSpec>,
pub doc: Option<String>,
pub is_union: bool,
pub align: Option<usize>,
pub expected_size: Option<usize>,
pub expected_size_64: Option<usize>,
pub no_default: bool,
}Expand description
Structured record declared with #[nv_hybrid_struct] or #[nv_hybrid_union].
Fields§
§name: String§fields: Vec<HybridFieldSpec>§doc: Option<String>§is_union: boolTrue when declared as #[nv_hybrid_union] pub union ....
align: Option<usize>Optional explicit #[repr(C, align(N))] alignment descriptor.
expected_size: Option<usize>Optional exact target-independent byte size (#[nv_hybrid_struct(size = N)]).
expected_size_64: Option<usize>Optional exact 64-bit byte size (#[nv_hybrid_struct(size_64 = N)]).
no_default: boolWhen true (#[nv_hybrid_struct(default = false)]), omit Rust Default derive/impl so
the owning crate can supply a domain-specific Default implementation.
Implementations§
Source§impl HybridStructSpec
impl HybridStructSpec
Sourcepub fn is_pod(&self, file: &HybridFileSpec) -> bool
pub fn is_pod(&self, file: &HybridFileSpec) -> bool
Returns true if all fields (transitively) are fixed-size C-ABI scalars/enums/POD structs.
Sourcepub fn supports_eq_and_hash(&self, file: &HybridFileSpec) -> bool
pub fn supports_eq_and_hash(&self, file: &HybridFileSpec) -> bool
Returns true if every field (transitively) implements Rust Eq and Hash
(i.e. contains no f32, f64, dynamic Value, raw pointer, handle, or union).
Sourcepub fn supports_default(&self, file: &HybridFileSpec) -> bool
pub fn supports_default(&self, file: &HybridFileSpec) -> bool
Returns true if this struct and every transitive field type support Rust Default
generation (i.e. neither this struct nor any transitive nested struct sets default = false,
and no field is a union, NvModStatus, Result, raw pointer, or handle).
Trait Implementations§
Source§impl Clone for HybridStructSpec
impl Clone for HybridStructSpec
Source§fn clone(&self) -> HybridStructSpec
fn clone(&self) -> HybridStructSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more