pub struct ExecResult { /* private fields */ }Expand description
Represents the result of an executed command in a container.
Implementationsยง
Sourceยงimpl ExecResult
impl ExecResult
Sourcepub async fn exit_code(&self) -> Result<Option<i64>, TestcontainersError>
pub async fn exit_code(&self) -> Result<Option<i64>, TestcontainersError>
Returns the exit code of the executed command.
If the command has not yet exited, this will return None.
Sourcepub fn stdout<'b>(&'b mut self) -> Pin<Box<dyn AsyncBufRead + 'b>>
pub fn stdout<'b>(&'b mut self) -> Pin<Box<dyn AsyncBufRead + 'b>>
Returns an asynchronous reader for stdout. It follows log stream until the command exits.
Sourcepub fn stderr<'b>(&'b mut self) -> Pin<Box<dyn AsyncBufRead + 'b>>
pub fn stderr<'b>(&'b mut self) -> Pin<Box<dyn AsyncBufRead + 'b>>
Returns an asynchronous reader for stderr. It follows log stream until the command exits.
Sourcepub async fn stdout_to_vec(&mut self) -> Result<Vec<u8>, TestcontainersError>
pub async fn stdout_to_vec(&mut self) -> Result<Vec<u8>, TestcontainersError>
Returns stdout as a vector of bytes. Keep in mind that this will block until the command exits.
If you want to read stdout in asynchronous manner, use ExecResult::stdout instead.
Sourcepub async fn stderr_to_vec(&mut self) -> Result<Vec<u8>, TestcontainersError>
pub async fn stderr_to_vec(&mut self) -> Result<Vec<u8>, TestcontainersError>
Returns stderr as a vector of bytes. Keep in mind that this will block until the command exits.
If you want to read stderr in asynchronous manner, use ExecResult::stderr instead.
Trait Implementationsยง
Auto Trait Implementationsยง
impl Freeze for ExecResult
impl !RefUnwindSafe for ExecResult
impl Send for ExecResult
impl !Sync for ExecResult
impl Unpin for ExecResult
impl !UnwindSafe for ExecResult
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
Sourceยงimpl<T> Instrument for T
impl<T> Instrument for T
Sourceยงfn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Sourceยงfn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Sourceยงimpl<T> IntoEither for T
impl<T> IntoEither for T
Sourceยงfn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSourceยงfn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more