pub struct BuildahExecutor { /* private fields */ }Expand description
Executor for buildah commands
Implementations§
Source§impl BuildahExecutor
impl BuildahExecutor
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Create a new BuildahExecutor, locating the buildah binary (sync version)
This will search for buildah in common system locations and PATH.
For more comprehensive discovery with version checking, use [new_async].
Sourcepub async fn new_async() -> Result<Self>
pub async fn new_async() -> Result<Self>
Create a new BuildahExecutor using the BuildahInstaller
This async version uses [BuildahInstaller] to find buildah and verify
it meets minimum version requirements. If buildah is not found, it returns
a helpful error with installation instructions.
§Example
use zlayer_builder::BuildahExecutor;
let executor = BuildahExecutor::new_async().await?;
let version = executor.version().await?;
println!("Using buildah version: {}", version);Sourcepub fn with_path(path: impl Into<PathBuf>) -> Self
pub fn with_path(path: impl Into<PathBuf>) -> Self
Create a BuildahExecutor with a specific path to the buildah binary
Sourcepub fn storage_driver(self, driver: impl Into<String>) -> Self
pub fn storage_driver(self, driver: impl Into<String>) -> Self
Set the storage driver
Sourcepub fn runroot(self, runroot: impl Into<PathBuf>) -> Self
pub fn runroot(self, runroot: impl Into<PathBuf>) -> Self
Set the runroot directory for buildah state
Sourcepub fn buildah_path(&self) -> &PathBuf
pub fn buildah_path(&self) -> &PathBuf
Get the path to the buildah binary
Sourcepub async fn execute(&self, cmd: &BuildahCommand) -> Result<CommandOutput>
pub async fn execute(&self, cmd: &BuildahCommand) -> Result<CommandOutput>
Execute a buildah command and wait for completion
Sourcepub async fn execute_checked(
&self,
cmd: &BuildahCommand,
) -> Result<CommandOutput>
pub async fn execute_checked( &self, cmd: &BuildahCommand, ) -> Result<CommandOutput>
Execute a buildah command and return an error if it fails
Sourcepub async fn execute_streaming<F>(
&self,
cmd: &BuildahCommand,
on_output: F,
) -> Result<CommandOutput>
pub async fn execute_streaming<F>( &self, cmd: &BuildahCommand, on_output: F, ) -> Result<CommandOutput>
Execute a buildah command with streaming output
The callback is called for each line of output (both stdout and stderr). The first parameter indicates whether it’s stdout (true) or stderr (false).
Sourcepub async fn is_available(&self) -> bool
pub async fn is_available(&self) -> bool
Check if buildah is available
Trait Implementations§
Source§impl Clone for BuildahExecutor
impl Clone for BuildahExecutor
Source§fn clone(&self) -> BuildahExecutor
fn clone(&self) -> BuildahExecutor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BuildahExecutor
impl Debug for BuildahExecutor
Auto Trait Implementations§
impl Freeze for BuildahExecutor
impl RefUnwindSafe for BuildahExecutor
impl Send for BuildahExecutor
impl Sync for BuildahExecutor
impl Unpin for BuildahExecutor
impl UnsafeUnpin for BuildahExecutor
impl UnwindSafe for BuildahExecutor
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