Skip to main content

LauncherCtx

Struct LauncherCtx 

Source
pub struct LauncherCtx<'a> {
Show 15 fields pub home: &'a Path, pub bin_dir: &'a Path, pub running_exe: &'a Path, pub host: Host, pub probe: &'a dyn ProcessProbe, pub now_ms: &'a dyn Fn() -> i64, pub path_has: &'a dyn Fn(&str) -> bool, pub opencode_bin: Option<&'a Path>, pub version: &'a str, pub parent_chain: &'a dyn Fn() -> Vec<String>, pub server_password: Option<&'a str>, pub spawn_detached: &'a dyn Fn(&mut Command) -> Result<u32>, pub spawn_and_wait: &'a SpawnAndWaitFn<'a>, pub before_claim: Option<&'a dyn Fn()>, pub out: &'a mut dyn Write,
}

Fields§

§home: &'a Path

= engine.env.home; the launcher asserts equality.

§bin_dir: &'a Path

~/.local/bin or %LOCALAPPDATA%\opencode-ctl; tests pass a temp dir.

§running_exe: &'a Path§host: Host§probe: &'a dyn ProcessProbe§now_ms: &'a dyn Fn() -> i64§path_has: &'a dyn Fn(&str) -> bool§opencode_bin: Option<&'a Path>

The RESOLVED opencode binary for the wrapper; None = OPENCODE_NOT_FOUND for pair and attach.

§version: &'a str

The front’s CARGO_PKG_VERSION: the version= line of opencode-pair.exe.source.

§parent_chain: &'a dyn Fn() -> Vec<String>§server_password: Option<&'a str>

OPENCODE_SERVER_PASSWORD at launch (empty = absent).

§spawn_detached: &'a dyn Fn(&mut Command) -> Result<u32>

The terminal tab: spawn and return the pid.

§spawn_and_wait: &'a SpawnAndWaitFn<'a>

The controller: calls the callback with the pid right after spawn, then waits.

§before_claim: Option<&'a dyn Fn()>

Test failpoint for attach: called after the record is read, before the first claim.

§out: &'a mut dyn Write

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for LauncherCtx<'a>

§

impl<'a> !Send for LauncherCtx<'a>

§

impl<'a> !Sync for LauncherCtx<'a>

§

impl<'a> !UnwindSafe for LauncherCtx<'a>

§

impl<'a> Freeze for LauncherCtx<'a>

§

impl<'a> Unpin for LauncherCtx<'a>

§

impl<'a> UnsafeUnpin for LauncherCtx<'a>

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.

§

impl<T> Instrument for T

§

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

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

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

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

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