pub struct AcpRuntimeManager { /* private fields */ }Expand description
Manages Node.js / uv runtime discovery and auto-download.
Implementations§
Source§impl AcpRuntimeManager
impl AcpRuntimeManager
Sourcepub fn new(paths: AcpPaths) -> AcpRuntimeManager
pub fn new(paths: AcpPaths) -> AcpRuntimeManager
Create a new runtime manager backed by the given AcpPaths.
Sourcepub async fn is_runtime_available(&self, rt: &RuntimeType) -> bool
pub async fn is_runtime_available(&self, rt: &RuntimeType) -> bool
Returns true if the runtime is reachable (managed or system).
Sourcepub async fn get_version(&self, rt: &RuntimeType) -> Option<String>
pub async fn get_version(&self, rt: &RuntimeType) -> Option<String>
Run {binary} --version and return the trimmed first line of output.
Returns None if the runtime is not available or the command fails.
Sourcepub async fn get_runtime_path(&self, rt: &RuntimeType) -> Option<PathBuf>
pub async fn get_runtime_path(&self, rt: &RuntimeType) -> Option<PathBuf>
Return the best path for a runtime: managed first, then system.
Sourcepub fn get_system_runtime(&self, rt: &RuntimeType) -> Option<RuntimeInfo>
pub fn get_system_runtime(&self, rt: &RuntimeType) -> Option<RuntimeInfo>
Locate the runtime on the system PATH.
Sourcepub async fn get_managed_runtime(&self, rt: &RuntimeType) -> Option<RuntimeInfo>
pub async fn get_managed_runtime(&self, rt: &RuntimeType) -> Option<RuntimeInfo>
Locate a previously downloaded (managed) runtime.
Sourcepub async fn ensure_runtime(
&self,
rt: &RuntimeType,
) -> Result<RuntimeInfo, String>
pub async fn ensure_runtime( &self, rt: &RuntimeType, ) -> Result<RuntimeInfo, String>
Ensure the runtime is available, downloading it if necessary.
Returns a RuntimeInfo with the resolved path.
Auto Trait Implementations§
impl Freeze for AcpRuntimeManager
impl !RefUnwindSafe for AcpRuntimeManager
impl Send for AcpRuntimeManager
impl Sync for AcpRuntimeManager
impl Unpin for AcpRuntimeManager
impl UnsafeUnpin for AcpRuntimeManager
impl !UnwindSafe for AcpRuntimeManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more