pub struct LeanCapability<'lean> { /* private fields */ }Expand description
Opened Lean capability whose dylib path and initializer names came from the build-script pairing.
Implementations§
Source§impl<'lean> LeanCapability<'lean>
impl<'lean> LeanCapability<'lean>
Sourcepub fn from_build_manifest(
runtime: &'lean LeanRuntime,
spec: LeanBuiltCapability,
) -> LeanResult<Self>
pub fn from_build_manifest( runtime: &'lean LeanRuntime, spec: LeanBuiltCapability, ) -> LeanResult<Self>
Sourcepub fn from_build_env(
runtime: &'lean LeanRuntime,
spec: LeanBuiltCapability,
) -> LeanResult<Self>
pub fn from_build_env( runtime: &'lean LeanRuntime, spec: LeanBuiltCapability, ) -> LeanResult<Self>
Open and initialize a build-script produced Lean capability from a direct dylib path.
This compatibility path cannot carry dependency ordering by itself.
Prefer Self::from_build_manifest for shipped crates.
§Errors
Returns LeanError when the dylib path cannot be resolved, the
dynamic loader cannot open it, or the configured module initializer
fails.
Sourcepub fn open(
runtime: &'lean LeanRuntime,
dylib_path: impl AsRef<Path>,
package: impl Into<String>,
module: impl Into<String>,
) -> LeanResult<Self>
pub fn open( runtime: &'lean LeanRuntime, dylib_path: impl AsRef<Path>, package: impl Into<String>, module: impl Into<String>, ) -> LeanResult<Self>
Sourcepub fn open_with_dependencies(
runtime: &'lean LeanRuntime,
dylib_path: impl AsRef<Path>,
package: impl Into<String>,
module: impl Into<String>,
dependencies: impl IntoIterator<Item = LeanLibraryDependency>,
) -> LeanResult<Self>
pub fn open_with_dependencies( runtime: &'lean LeanRuntime, dylib_path: impl AsRef<Path>, package: impl Into<String>, module: impl Into<String>, dependencies: impl IntoIterator<Item = LeanLibraryDependency>, ) -> LeanResult<Self>
Open and initialize a capability with explicitly described dependency dylibs.
This is the runtime form artifact manifests feed. Use
LeanCapability::from_build_manifest for shipped crates when
build-script metadata is available.
§Errors
Returns LeanError when a dependency or primary dylib cannot be
loaded, or when a dependency or primary module initializer fails.
Sourcepub fn module(&self) -> LeanResult<LeanModule<'lean, '_>>
pub fn module(&self) -> LeanResult<LeanModule<'lean, '_>>
Sourcepub fn library(&self) -> &LeanLibrary<'lean>
pub fn library(&self) -> &LeanLibrary<'lean>
Borrow the underlying library for advanced symbol access.
Sourcepub fn bundle(&self) -> &LeanLibraryBundle<'lean>
pub fn bundle(&self) -> &LeanLibraryBundle<'lean>
Borrow the bundle that anchors this capability and its dependencies.
Sourcepub fn package_name(&self) -> &str
pub fn package_name(&self) -> &str
Lake package name used by the initializer.
Sourcepub fn module_name(&self) -> &str
pub fn module_name(&self) -> &str
Root Lean module name used by the initializer.