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