pub enum HybridType {
Show 24 variants
Void,
Bool,
U8,
U16,
Usize,
I32,
U32,
I64,
U64,
F32,
F64,
String,
Bytes,
Optional(Box<HybridType>),
Vec(Box<HybridType>),
Result {
ok: Box<HybridType>,
err: Box<HybridType>,
},
Struct(String),
Enum(String),
Value,
ModStatus,
ConstPtr(Box<HybridType>),
MutPtr(Box<HybridType>),
FixedArray {
elem: Box<HybridType>,
len: usize,
},
Handle(String),
}Expand description
Rich typed system shared across Hybrid modules, views, structs, enums, and events.
Variants§
Void
Bool
U8
U16
Usize
I32
U32
I64
U64
F32
F64
String
Bytes
Optional(Box<HybridType>)
Vec(Box<HybridType>)
Result
Struct(String)
Enum(String)
Value
ModStatus
ConstPtr(Box<HybridType>)
MutPtr(Box<HybridType>)
FixedArray
Handle(String)
Implementations§
Source§impl HybridType
impl HybridType
Sourcepub fn canonical_signature(&self) -> String
pub fn canonical_signature(&self) -> String
Canonical deterministic type signature used for XXH64 schema hashing.
Sourcepub fn is_pod(&self, file: &HybridFileSpec) -> bool
pub fn is_pod(&self, file: &HybridFileSpec) -> bool
True if this type is a fixed-size C-ABI scalar or POD struct that can be passed directly by value across C11/C++20/Rust/Swift/Dart FFI without serialization.
Sourcepub fn supports_eq_and_hash(&self, file: &HybridFileSpec) -> bool
pub fn supports_eq_and_hash(&self, file: &HybridFileSpec) -> bool
True if the generated Rust type supports deriving Eq and Hash transitively.
Sourcepub fn supports_default(&self, file: &HybridFileSpec) -> bool
pub fn supports_default(&self, file: &HybridFileSpec) -> bool
True if the generated Rust type supports deriving or synthesizing Default transitively.
Sourcepub fn fixed_array_dims(&self) -> (Vec<usize>, &HybridType)
pub fn fixed_array_dims(&self) -> (Vec<usize>, &HybridType)
The dimensions of a (nested) [T; N], outermost first, and its innermost element:
[[u32; 2]; 3] is ([3, 2], u32); any other type is ([], self).
Sourcepub fn collect_refs(
&self,
structs: &mut BTreeSet<String>,
enums: &mut BTreeSet<String>,
)
pub fn collect_refs( &self, structs: &mut BTreeSet<String>, enums: &mut BTreeSet<String>, )
Collects all referenced user struct and enum names into structs and enums.
Sourcepub fn pod_opt_suffix(&self) -> Option<Cow<'static, str>>
pub fn pod_opt_suffix(&self) -> Option<Cow<'static, str>>
Deterministic C-ABI option wrapper suffix for POD optional types (Optional<T>).
Returns Some("I64"), Some("Vec2"), etc. when self is a POD inner type.
Sourcepub fn pod_opt_suffix_for(
&self,
file: &HybridFileSpec,
) -> Option<Cow<'static, str>>
pub fn pod_opt_suffix_for( &self, file: &HybridFileSpec, ) -> Option<Cow<'static, str>>
Returns the deterministic C-ABI option wrapper suffix if and only if self is a valid
POD type in file with a direct NvHybridOpt<Suffix> representation.
Sourcepub fn optional_pod_suffix(
&self,
file: &HybridFileSpec,
) -> Option<Cow<'static, str>>
pub fn optional_pod_suffix( &self, file: &HybridFileSpec, ) -> Option<Cow<'static, str>>
Returns the deterministic C-ABI option wrapper suffix if and only if self is
HybridType::Optional(inner) where inner is a valid POD type in file.
Trait Implementations§
Source§impl Clone for HybridType
impl Clone for HybridType
Source§fn clone(&self) -> HybridType
fn clone(&self) -> HybridType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more