pub struct BinaryManager { /* private fields */ }Expand description
Service for managing node binary downloads and caching
find_cached, find_cached_version, binary_name(_with_version),
tarball_name(_with_version), and download are structurally similar to
mecha10-node-resolver::NodeResolver’s equivalents (LAB-2762). Re-reviewed under LAB-2803
with a shared-trait/module extraction specifically in mind: that’s intentionally still not
addressed by merging the two. Each is already a thin delegate to the shared
mecha10-binary-naming crate (the actual single source of truth for naming/caching logic),
and unifying the two callers further would require node-resolver to depend on this crate
or mecha10-cli-core, which violates its documented zero-dependency-on-mecha10-cli-core
design goal (minimal binary size for embedding in robot binaries - see NodeResolver’s doc
comment). This service also does more than NodeResolver ever should (progress-bar
rendering, a cargo install fallback for unsupported platforms, Windows symlink support),
so a shared trait would either dilute NodeResolver’s minimal surface or force it to grow
the dependency footprint it’s designed to avoid. cargo-dupes no longer flags this pair at all
under the workspace’s tuned thresholds (dupes.toml) - only the unavoidable thin per-crate
wrapper methods remain. See .dupes-ignore.toml for the per-fingerprint reasoning on other
groups.
Implementations§
Source§impl BinaryManager
impl BinaryManager
Sourcepub fn new() -> Result<BinaryManager, Error>
pub fn new() -> Result<BinaryManager, Error>
Create a new binary manager
Sourcepub fn with_version(version: String) -> Result<BinaryManager, Error>
pub fn with_version(version: String) -> Result<BinaryManager, Error>
Create a binary manager with a specific version
Sourcepub fn is_prebuilt_available(&self) -> bool
pub fn is_prebuilt_available(&self) -> bool
Check if pre-built binaries are available for current platform
Sourcepub async fn resolve(&self, node_name: &str) -> Result<PathBuf, Error>
pub async fn resolve(&self, node_name: &str) -> Result<PathBuf, Error>
Resolve binary path for a node, downloading if needed
Resolution strategy:
- Check if cached binary exists for current version/target
- If not, try to download from GitHub releases
- If download fails and platform unsupported, fall back to cargo install
§Arguments
node_name- Name of the node (e.g., “speaker”, “motor”)
§Returns
Path to the executable binary
Sourcepub async fn resolve_with_version(
&self,
node_name: &str,
version: Option<&str>,
) -> Result<PathBuf, Error>
pub async fn resolve_with_version( &self, node_name: &str, version: Option<&str>, ) -> Result<PathBuf, Error>
Sourcepub async fn clear_cache(&self) -> Result<(), Error>
pub async fn clear_cache(&self) -> Result<(), Error>
Clear all cached binaries
Trait Implementations§
Source§impl Default for BinaryManager
impl Default for BinaryManager
Source§fn default() -> BinaryManager
fn default() -> BinaryManager
Auto Trait Implementations§
impl Freeze for BinaryManager
impl RefUnwindSafe for BinaryManager
impl Send for BinaryManager
impl Sync for BinaryManager
impl Unpin for BinaryManager
impl UnsafeUnpin for BinaryManager
impl UnwindSafe for BinaryManager
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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> ⓘ
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> ⓘ
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.