pub struct ContainerRename { /* private fields */ }Expand description
Rename a container.
§Examples
use ironflow_ops_docker::containers::ContainerRename;
use ironflow_ops_docker::DockerClient;
use ironflow_core::operation::Operation;
let client = DockerClient::connect_local().unwrap();
let op = ContainerRename::new(&client, "old-name", "new-name");
assert_eq!(op.kind(), "docker");Implementations§
Source§impl ContainerRename
impl ContainerRename
Sourcepub fn new(
client: impl Into<DockerRef>,
container: impl Into<String>,
new_name: impl Into<String>,
) -> Self
pub fn new( client: impl Into<DockerRef>, container: impl Into<String>, new_name: impl Into<String>, ) -> Self
Create a new container-rename operation.
Sourcepub async fn run(
&self,
_ctx: &OperationContext,
) -> Result<ContainerRenameOutput, OperationError>
pub async fn run( &self, _ctx: &OperationContext, ) -> Result<ContainerRenameOutput, OperationError>
Execute and return a typed result.
§Errors
Returns OperationError::External if the container does not exist.
Trait Implementations§
Source§impl Operation for ContainerRename
impl Operation for ContainerRename
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 ContainerRename
impl TypedOperation for ContainerRename
Source§type Output = ContainerRenameOutput
type Output = ContainerRenameOutput
The concrete output type that
Operation::execute produces.Auto Trait Implementations§
impl !RefUnwindSafe for ContainerRename
impl !UnwindSafe for ContainerRename
impl Freeze for ContainerRename
impl Send for ContainerRename
impl Sync for ContainerRename
impl Unpin for ContainerRename
impl UnsafeUnpin for ContainerRename
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