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