pub struct ContainerProbe { /* private fields */ }Expand description
Runs short read-only scripts inside a container and returns what they print, through the same exec path commands use.
Implementations§
Source§impl ContainerProbe
impl ContainerProbe
Sourcepub fn new(exec: &AnyContainerExec, container_id: impl Into<String>) -> Self
pub fn new(exec: &AnyContainerExec, container_id: impl Into<String>) -> Self
A probe of container container_id through exec.
The agent’s home directory in the container is the one commands run
in until Self::with_home says otherwise.
Sourcepub fn with_home(self, home: ContainerPath) -> Self
pub fn with_home(self, home: ContainerPath) -> Self
Names the directory the agent works in inside the container.
Sourcepub const fn home(&self) -> &ContainerPath
pub const fn home(&self) -> &ContainerPath
The directory the agent works in inside the container.
Sourcepub async fn free_bytes(&self) -> Result<u64, ContainerProbeError>
pub async fn free_bytes(&self) -> Result<u64, ContainerProbeError>
The bytes free to the container’s processes on the filesystem that holds the agent’s home directory, as that filesystem reports them: bounded by its own size limit when the container has one.
§Errors
Fails when the container cannot run df or answers something else.
§Panics
Panics when the built-in probe template does not render.
Trait Implementations§
Source§impl Clone for ContainerProbe
impl Clone for ContainerProbe
Auto Trait Implementations§
impl !RefUnwindSafe for ContainerProbe
impl !UnwindSafe for ContainerProbe
impl Forget for ContainerProbe
impl Freeze for ContainerProbe
impl Move for ContainerProbe
impl Send for ContainerProbe
impl Sync for ContainerProbe
impl Unpin for ContainerProbe
impl UnsafeUnpin for ContainerProbe
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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