pub struct NvAppModule { /* private fields */ }Expand description
Ref-counted handle to one loaded app module generation (Arc<StagedDylib> or static
NvGetInterfaceFn).
Cloning is an O(1) atomic refcount bump that shares the single mapped cdylib across all
surfaces attached to the same generation ([INV:multi-surface-shared-dylib]).
Implementations§
Source§impl NvAppModule
impl NvAppModule
Sourcepub fn load(
dylib_path: &Path,
subdir: &str,
label: &str,
) -> Result<Self, LoaderError>
pub fn load( dylib_path: &Path, subdir: &str, label: &str, ) -> Result<Self, LoaderError>
Stages and dlopens dylib_path once (generation 1) into a shared NvAppModule.
Sourcepub fn load_generation(
dylib_path: &Path,
subdir: &str,
generation: u64,
) -> Result<Self, LoaderError>
pub fn load_generation( dylib_path: &Path, subdir: &str, generation: u64, ) -> Result<Self, LoaderError>
Stages and dlopens dylib_path once for reload generation into a shared
NvAppModule.
Sourcepub fn from_staged_dylib(staged: Arc<StagedDylib>, generation: u64) -> Self
pub fn from_staged_dylib(staged: Arc<StagedDylib>, generation: u64) -> Self
Wraps an already-loaded StagedDylib as generation generation (staged_loads == 1).
Sourcepub fn from_get_interface(get_interface: NvGetInterfaceFn) -> Self
pub fn from_get_interface(get_interface: NvGetInterfaceFn) -> Self
Wraps a statically linked or in-process nv_get_interface entry point (zero dylib
staging; works on every target including wasm32).
Sourcepub fn from_get_interface_generation(
get_interface: NvGetInterfaceFn,
generation: u64,
) -> Self
pub fn from_get_interface_generation( get_interface: NvGetInterfaceFn, generation: u64, ) -> Self
Wraps a statically linked nv_get_interface entry point tagged with generation.
Sourcepub fn get_interface(&self) -> NvGetInterfaceFn
pub fn get_interface(&self) -> NvGetInterfaceFn
Returns the resolved nv_get_interface entry point backed by this module.
Sourcepub fn generation(&self) -> u64
pub fn generation(&self) -> u64
Reload generation of this module (1 for initial load, incremented per atomic reload).
Sourcepub fn staged_loads(&self) -> u64
pub fn staged_loads(&self) -> u64
Number of staged cdylib loads performed to produce this generation (1 for dylib loads,
0 for statically linked nv_get_interface).
Sourcepub fn loaded_copy_path(&self) -> Option<&Path>
pub fn loaded_copy_path(&self) -> Option<&Path>
Path of the private staged copy (or resolved in-place file on mobile), or None for
statically linked modules.
Sourcepub fn strong_count(&self) -> usize
pub fn strong_count(&self) -> usize
Strong reference count of the underlying Arc<StagedDylib> (1 for static modules).
Sourcepub fn same_backing(&self, other: &Self) -> bool
pub fn same_backing(&self, other: &Self) -> bool
Returns true when both handles share the exact same underlying mapped StagedDylib
allocation (or identical static nv_get_interface function pointer).