pub struct ImageRemove { /* private fields */ }Expand description
Remove an image.
§Examples
use ironflow_ops_docker::images::ImageRemove;
use ironflow_ops_docker::DockerClient;
use ironflow_core::operation::Operation;
let client = DockerClient::connect_local().unwrap();
let op = ImageRemove::new(&client, "alpine:latest");
assert_eq!(op.kind(), "docker");Implementations§
Source§impl ImageRemove
impl ImageRemove
Sourcepub fn new(client: impl Into<DockerRef>, image: impl Into<String>) -> Self
pub fn new(client: impl Into<DockerRef>, image: impl Into<String>) -> Self
Create a new image-remove operation.
Sourcepub async fn run(
&self,
_ctx: &OperationContext,
) -> Result<ImageRemoveOutput, OperationError>
pub async fn run( &self, _ctx: &OperationContext, ) -> Result<ImageRemoveOutput, OperationError>
Execute and return a typed result.
§Errors
Returns OperationError::External if the image does not exist.
Trait Implementations§
Source§impl Operation for ImageRemove
impl Operation for ImageRemove
Source§fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 OperationContext,
) -> Pin<Box<dyn Future<Output = Result<Value, OperationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 OperationContext,
) -> Pin<Box<dyn Future<Output = Result<Value, OperationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execute the operation and return the result as JSON. Read more
Source§impl TypedOperation for ImageRemove
impl TypedOperation for ImageRemove
Source§type Output = ImageRemoveOutput
type Output = ImageRemoveOutput
The concrete output type that
Operation::execute produces.Auto Trait Implementations§
impl !RefUnwindSafe for ImageRemove
impl !UnwindSafe for ImageRemove
impl Freeze for ImageRemove
impl Send for ImageRemove
impl Sync for ImageRemove
impl Unpin for ImageRemove
impl UnsafeUnpin for ImageRemove
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