pub struct HybridViewSpec {
pub name: String,
pub trait_name: String,
pub binding: HybridBinding,
pub props: Vec<HybridPropSpec>,
pub events: Vec<HybridEventSpec>,
pub methods: Vec<HybridMethodSpec>,
pub doc: Option<String>,
pub explicit_interface_id: Option<InterfaceId>,
pub symbol: Option<String>,
}Expand description
Nitro-style native view component declared with #[nv_hybrid_view(name = "...")].
Fields§
§name: String§trait_name: String§binding: HybridBinding§props: Vec<HybridPropSpec>§events: Vec<HybridEventSpec>§methods: Vec<HybridMethodSpec>§doc: Option<String>§explicit_interface_id: Option<InterfaceId>Optional explicit fixed interface ID override. Defaults to deterministic XXH64 ID
>= 0x1000_0000 when None.
symbol: Option<String>Optional explicit C entry-point symbol (#[nv_hybrid_view(symbol = "...")]).
Defaults to "nv_get_interface" for single-view specs or "nv_get_interface_<snake>"
when a spec file exports multiple views.
Implementations§
Source§impl HybridViewSpec
impl HybridViewSpec
Sourcepub fn interface_id(&self) -> InterfaceId
pub fn interface_id(&self) -> InterfaceId
Interface ID: returns explicit_interface_id when set, otherwise a deterministic ID
in the reserved hybrid range (>= 0x1000_0000).
Sourcepub fn vtable_symbol(&self, file: &HybridFileSpec) -> String
pub fn vtable_symbol(&self, file: &HybridFileSpec) -> String
Deterministic, collision-free C vtable entry-point symbol for exporting this view.
Uses symbol if explicitly provided; otherwise "nv_get_interface" when file declares
at most one view, or "nv_get_interface_<snake_name>" when file declares multiple views.
Sourcepub fn referenced_types<'a>(
&self,
file: &'a HybridFileSpec,
) -> (Vec<&'a HybridEnumSpec>, Vec<&'a HybridStructSpec>)
pub fn referenced_types<'a>( &self, file: &'a HybridFileSpec, ) -> (Vec<&'a HybridEnumSpec>, Vec<&'a HybridStructSpec>)
Collects all transitively referenced enums (in declaration order) and structs (in topological dependency order) reachable from this view’s props, events, and methods.
Sourcepub fn schema_hash(&self, file: &HybridFileSpec) -> u64
pub fn schema_hash(&self, file: &HybridFileSpec) -> u64
Deterministic XXH64 schema hash covering this view’s props, events, methods, and all transitively referenced structs and enums.
Trait Implementations§
Source§impl Clone for HybridViewSpec
impl Clone for HybridViewSpec
Source§fn clone(&self) -> HybridViewSpec
fn clone(&self) -> HybridViewSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more