Skip to main content

HybridFileSpec

Struct HybridFileSpec 

Source
pub struct HybridFileSpec {
    pub namespace: Option<String>,
    pub consts: Vec<HybridConstSpec>,
    pub aliases: Vec<HybridAliasSpec>,
    pub enums: Vec<HybridEnumSpec>,
    pub structs: Vec<HybridStructSpec>,
    pub modules: Vec<HybridModuleSpec>,
    pub views: Vec<HybridViewSpec>,
    pub c_functions: Vec<HybridMethodSpec>,
}
Expand description

Complete parsed or programmatically constructed Hybrid FFI specification file.

Fields§

§namespace: Option<String>§consts: Vec<HybridConstSpec>§aliases: Vec<HybridAliasSpec>§enums: Vec<HybridEnumSpec>§structs: Vec<HybridStructSpec>§modules: Vec<HybridModuleSpec>§views: Vec<HybridViewSpec>§c_functions: Vec<HybridMethodSpec>

Implementations§

Source§

impl HybridFileSpec

Source

pub fn find_struct(&self, name: &str) -> Option<&HybridStructSpec>

Source

pub fn find_enum(&self, name: &str) -> Option<&HybridEnumSpec>

Source

pub fn stem_pascal(&self) -> String

PascalCase stem used for generated filenames (<Stem>HybridAbi.h, <Stem>HybridSpec.swift, etc.).

Source

pub fn stem_snake(&self) -> String

snake_case stem used for Rust/Dart/TS generated filenames (<stem>_hybrid.rs, etc.).

Source

pub fn android_package(&self) -> String

Java/Kotlin package name derived from namespace. Dotted namespaces (e.g. "io.github.nativeview.components") are kept verbatim; single-segment namespaces (e.g. "acme_media") are scoped under "io.github.nativeview.<snake>"; omitted namespaces default to "io.github.nativeview.components".

Source

pub fn file_schema_hash(&self) -> u64

Deterministic file-wide 64-bit schema hash covering all items in order.

Source

pub fn structs_topological(&self) -> Vec<&HybridStructSpec>

Returns all structs in topological dependency order (dependencies emitted before dependents so C11/C++20 structs that embed POD structs by value always compile cleanly).

Source

pub fn pod_option_uses( &self, scope: PodOptionScope, ) -> impl Iterator<Item = (Cow<'static, str>, &HybridType)>

Every (suffix, inner) use of a C option NvHybridOpt<suffix>: an Option<T> of a POD T as a parameter, return, or Result ok type of a method in scope. Two uses may share a suffix; validation rejects two different inners on one suffix.

Source

pub fn collect_pod_option_types( &self, scope: PodOptionScope, ) -> Vec<(Cow<'static, str>, HybridType)>

The distinct C options NvHybridOpt<suffix> of scope, by suffix.

Source§

impl HybridFileSpec

Source

pub fn validate(&self) -> Result<(), SpecError>

Trait Implementations§

Source§

impl Clone for HybridFileSpec

Source§

fn clone(&self) -> HybridFileSpec

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for HybridFileSpec

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for HybridFileSpec

Source§

fn default() -> HybridFileSpec

Returns the “default value” for a type. Read more
Source§

impl PartialEq for HybridFileSpec

Source§

fn eq(&self, other: &HybridFileSpec) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for HybridFileSpec

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.