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