Skip to main content

LeanCapability

Struct LeanCapability 

Source
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>

Source

pub fn from_build_manifest( runtime: &'lean LeanRuntime, spec: LeanBuiltCapability, ) -> LeanResult<Self>

Open and initialize a build-script produced Lean capability from its JSON artifact manifest.

§Errors

Returns LeanError when the manifest path cannot be resolved, the manifest is missing, malformed, or unsupported, or the bundle described by the manifest cannot be opened.

Source

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.

Source

pub fn open( runtime: &'lean LeanRuntime, dylib_path: impl AsRef<Path>, package: impl Into<String>, module: impl Into<String>, ) -> LeanResult<Self>

Open and initialize a capability from an explicit dylib path and initializer names.

§Errors

Returns LeanError when the dynamic loader cannot open the dylib or the configured module initializer fails.

Source

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.

Source

pub fn module(&self) -> LeanResult<LeanModule<'lean, '_>>

Return an initialized module handle.

Lean module initializers are idempotent, so obtaining the handle after construction is cheap and safe.

§Errors

Returns LeanError if the module initializer unexpectedly fails when invoked again.

Source

pub fn library(&self) -> &LeanLibrary<'lean>

Borrow the underlying library for advanced symbol access.

Source

pub fn bundle(&self) -> &LeanLibraryBundle<'lean>

Borrow the bundle that anchors this capability and its dependencies.

Source

pub fn package_name(&self) -> &str

Lake package name used by the initializer.

Source

pub fn module_name(&self) -> &str

Root Lean module name used by the initializer.

Auto Trait Implementations§

§

impl<'lean> Freeze for LeanCapability<'lean>

§

impl<'lean> RefUnwindSafe for LeanCapability<'lean>

§

impl<'lean> !Send for LeanCapability<'lean>

§

impl<'lean> !Sync for LeanCapability<'lean>

§

impl<'lean> Unpin for LeanCapability<'lean>

§

impl<'lean> UnsafeUnpin for LeanCapability<'lean>

§

impl<'lean> UnwindSafe for LeanCapability<'lean>

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more