Skip to main content

LeanWorkerHostHandleBuilder

Struct LeanWorkerHostHandleBuilder 

Source
pub struct LeanWorkerHostHandleBuilder { /* private fields */ }
Expand description

Builder for a worker-backed host session that loads only bundled shims.

This is the bootstrap path for tools that use the standard host services exposed through lean-rs-host: Meta queries, elaboration, kernel checking, declaration listing, source ranges, and info trees. It deliberately has no package/library fields and no metadata validation hook because no user @[export] dylib is built or opened.

Implementations§

Source§

impl LeanWorkerHostHandleBuilder

Source

pub fn shims_only( project_root: impl Into<PathBuf>, imports: impl IntoIterator<Item = impl Into<String>>, ) -> Self

Create a shims-only worker host-session builder for a Lake project.

project_root is the directory containing lakefile.lean. imports are the modules to import when the builder performs its initial session open. The builder does not build a Lake :shared target.

Source

pub fn worker_executable(self, path: impl Into<PathBuf>) -> Self

Use an explicit lean-rs-worker-child executable.

Source

pub fn worker_child(self, child: LeanWorkerChild) -> Self

Resolve the worker executable with a packaged worker-child locator.

Source

pub fn startup_timeout(self, timeout: Duration) -> Self

Set the maximum time to wait for worker startup.

Source

pub fn request_timeout(self, timeout: Duration) -> Self

Set the maximum time to wait for one worker request.

Source

pub fn long_running_requests(self) -> Self

Use the documented long-running request timeout profile.

Source

pub fn restart_policy(self, policy: LeanWorkerRestartPolicy) -> Self

Set the worker restart policy used after startup.

Source

pub fn max_frame_bytes(self, max_frame_bytes: u32) -> Self

Set the per-frame byte cap negotiated with the worker child at handshake.

Source

pub fn check(&self) -> LeanWorkerBootstrapReport

Check worker bootstrap facts before running a real command.

The report validates the worker child locator, protocol handshake, and shims-only session opening. It never builds a user shared-library target.

Source

pub fn open(self) -> Result<LeanWorkerHostHandle, LeanWorkerError>

Start the worker, open a shims-only host session once, and return a ready handle.

§Errors

Returns LeanWorkerError if the worker child cannot be resolved or spawned, startup/health fails, or the shims-only session cannot open. This method does not build a user Lake shared-library target.

Trait Implementations§

Source§

impl Clone for LeanWorkerHostHandleBuilder

Source§

fn clone(&self) -> LeanWorkerHostHandleBuilder

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 LeanWorkerHostHandleBuilder

Source§

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

Formats the value using the given formatter. Read more

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

Source§

type Output = T

Should always be Self
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 = 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.