pub struct BuildahInstaller { /* private fields */ }Expand description
Buildah installation manager
Handles finding existing buildah installations and providing installation guidance when buildah is not found.
Implementations§
Source§impl BuildahInstaller
impl BuildahInstaller
Sourcepub fn new() -> Self
pub fn new() -> Self
Create installer with default paths
User install directory: ~/.zlayer/bin/
System install directory: /usr/local/lib/zlayer/
Sourcepub fn with_install_dir(dir: PathBuf) -> Self
pub fn with_install_dir(dir: PathBuf) -> Self
Create with custom install directory
Sourcepub fn install_dir(&self) -> &Path
pub fn install_dir(&self) -> &Path
Get the install directory
Sourcepub fn min_version(&self) -> &str
pub fn min_version(&self) -> &str
Get the minimum required version
Sourcepub async fn find_existing(&self) -> Option<BuildahInstallation>
pub async fn find_existing(&self) -> Option<BuildahInstallation>
Find existing buildah installation
Searches for buildah in the following locations (in order):
- PATH environment variable
~/.zlayer/bin/buildah/usr/local/lib/zlayer/buildah/usr/bin/buildah/usr/local/bin/buildah
Sourcepub async fn check(&self) -> Result<BuildahInstallation, InstallError>
pub async fn check(&self) -> Result<BuildahInstallation, InstallError>
Check if buildah is installed and meets version requirements
Returns the installation if found and valid, otherwise returns an error.
§Errors
Returns an error if buildah is not found or if the version is below the minimum.
Sourcepub async fn get_version(path: &Path) -> Result<String, InstallError>
pub async fn get_version(path: &Path) -> Result<String, InstallError>
Get buildah version from a binary
Runs buildah --version and parses the output.
Expected format: “buildah version 1.33.0 (image-spec 1.0.2-dev, runtime-spec 1.0.2-dev)”
§Errors
Returns an error if the binary cannot be executed or the version output cannot be parsed.
Sourcepub async fn ensure(&self) -> Result<BuildahInstallation, InstallError>
pub async fn ensure(&self) -> Result<BuildahInstallation, InstallError>
Ensure buildah is available (find existing or return helpful error)
This is the primary entry point for ensuring buildah is available. If buildah is not found, it returns an error with installation instructions.
§Errors
Returns an error if buildah is not found or the version is insufficient.
Sourcepub async fn download(&self) -> Result<BuildahInstallation, InstallError>
pub async fn download(&self) -> Result<BuildahInstallation, InstallError>
Download buildah binary for current platform
Currently returns an error with installation instructions. Future versions may download static binaries from GitHub releases.
§Errors
Returns an error if the platform is unsupported or automatic download is unavailable.
Trait Implementations§
Source§impl Clone for BuildahInstaller
impl Clone for BuildahInstaller
Source§fn clone(&self) -> BuildahInstaller
fn clone(&self) -> BuildahInstaller
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BuildahInstaller
impl Debug for BuildahInstaller
Auto Trait Implementations§
impl Freeze for BuildahInstaller
impl RefUnwindSafe for BuildahInstaller
impl Send for BuildahInstaller
impl Sync for BuildahInstaller
impl Unpin for BuildahInstaller
impl UnsafeUnpin for BuildahInstaller
impl UnwindSafe for BuildahInstaller
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more