pub struct Hooks { /* private fields */ }
Expand description
Hooks specifies a command that is run in the container at a particular event in the lifecycle (setup and teardown) of a container.
Implementations§
Source§impl Hooks
impl Hooks
Sourcepub fn prestart_mut(&mut self) -> &mut Option<Vec<Hook>>
pub fn prestart_mut(&mut self) -> &mut Option<Vec<Hook>>
The prestart
hooks MUST be called after the start
operation is
called but before the user-specified program command is
executed.
On Linux, for example, they are called after the container namespaces are created, so they provide an opportunity to customize the container (e.g. the network namespace could be specified in this hook).
The prestart
hooks’ path MUST resolve in the runtime namespace.
The prestart
hooks MUST be executed in the runtime namespace.
Sourcepub fn create_runtime_mut(&mut self) -> &mut Option<Vec<Hook>>
pub fn create_runtime_mut(&mut self) -> &mut Option<Vec<Hook>>
CreateRuntime is a list of hooks to be run after the container has
been created but before pivot_root
or any equivalent
operation has been called. It is called in the Runtime
Namespace.
Sourcepub fn create_container_mut(&mut self) -> &mut Option<Vec<Hook>>
pub fn create_container_mut(&mut self) -> &mut Option<Vec<Hook>>
CreateContainer is a list of hooks to be run after the container has
been created but before pivot_root
or any equivalent
operation has been called. It is called in the
Container Namespace.
Sourcepub fn start_container_mut(&mut self) -> &mut Option<Vec<Hook>>
pub fn start_container_mut(&mut self) -> &mut Option<Vec<Hook>>
StartContainer is a list of hooks to be run after the start operation is called but before the container process is started. It is called in the Container Namespace.
Sourcepub fn poststart_mut(&mut self) -> &mut Option<Vec<Hook>>
pub fn poststart_mut(&mut self) -> &mut Option<Vec<Hook>>
Poststart is a list of hooks to be run after the container process is started. It is called in the Runtime Namespace.
Sourcepub fn poststop_mut(&mut self) -> &mut Option<Vec<Hook>>
pub fn poststop_mut(&mut self) -> &mut Option<Vec<Hook>>
Poststop is a list of hooks to be run after the container process exits. It is called in the Runtime Namespace.
Source§impl Hooks
impl Hooks
Sourcepub fn prestart(&self) -> &Option<Vec<Hook>>
pub fn prestart(&self) -> &Option<Vec<Hook>>
The prestart
hooks MUST be called after the start
operation is
called but before the user-specified program command is
executed.
On Linux, for example, they are called after the container namespaces are created, so they provide an opportunity to customize the container (e.g. the network namespace could be specified in this hook).
The prestart
hooks’ path MUST resolve in the runtime namespace.
The prestart
hooks MUST be executed in the runtime namespace.
Sourcepub fn create_runtime(&self) -> &Option<Vec<Hook>>
pub fn create_runtime(&self) -> &Option<Vec<Hook>>
CreateRuntime is a list of hooks to be run after the container has
been created but before pivot_root
or any equivalent
operation has been called. It is called in the Runtime
Namespace.
Sourcepub fn create_container(&self) -> &Option<Vec<Hook>>
pub fn create_container(&self) -> &Option<Vec<Hook>>
CreateContainer is a list of hooks to be run after the container has
been created but before pivot_root
or any equivalent
operation has been called. It is called in the
Container Namespace.
Sourcepub fn start_container(&self) -> &Option<Vec<Hook>>
pub fn start_container(&self) -> &Option<Vec<Hook>>
StartContainer is a list of hooks to be run after the start operation is called but before the container process is started. It is called in the Container Namespace.
Source§impl Hooks
impl Hooks
Sourcepub fn set_prestart(&mut self, val: Option<Vec<Hook>>) -> &mut Self
pub fn set_prestart(&mut self, val: Option<Vec<Hook>>) -> &mut Self
The prestart
hooks MUST be called after the start
operation is
called but before the user-specified program command is
executed.
On Linux, for example, they are called after the container namespaces are created, so they provide an opportunity to customize the container (e.g. the network namespace could be specified in this hook).
The prestart
hooks’ path MUST resolve in the runtime namespace.
The prestart
hooks MUST be executed in the runtime namespace.
Sourcepub fn set_create_runtime(&mut self, val: Option<Vec<Hook>>) -> &mut Self
pub fn set_create_runtime(&mut self, val: Option<Vec<Hook>>) -> &mut Self
CreateRuntime is a list of hooks to be run after the container has
been created but before pivot_root
or any equivalent
operation has been called. It is called in the Runtime
Namespace.
Sourcepub fn set_create_container(&mut self, val: Option<Vec<Hook>>) -> &mut Self
pub fn set_create_container(&mut self, val: Option<Vec<Hook>>) -> &mut Self
CreateContainer is a list of hooks to be run after the container has
been created but before pivot_root
or any equivalent
operation has been called. It is called in the
Container Namespace.
Sourcepub fn set_start_container(&mut self, val: Option<Vec<Hook>>) -> &mut Self
pub fn set_start_container(&mut self, val: Option<Vec<Hook>>) -> &mut Self
StartContainer is a list of hooks to be run after the start operation is called but before the container process is started. It is called in the Container Namespace.
Sourcepub fn set_poststart(&mut self, val: Option<Vec<Hook>>) -> &mut Self
pub fn set_poststart(&mut self, val: Option<Vec<Hook>>) -> &mut Self
Poststart is a list of hooks to be run after the container process is started. It is called in the Runtime Namespace.
Sourcepub fn set_poststop(&mut self, val: Option<Vec<Hook>>) -> &mut Self
pub fn set_poststop(&mut self, val: Option<Vec<Hook>>) -> &mut Self
Poststop is a list of hooks to be run after the container process exits. It is called in the Runtime Namespace.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Hooks
impl<'de> Deserialize<'de> for Hooks
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Hooks
impl StructuralPartialEq for Hooks
Auto Trait Implementations§
impl Freeze for Hooks
impl RefUnwindSafe for Hooks
impl Send for Hooks
impl Sync for Hooks
impl Unpin for Hooks
impl UnwindSafe for Hooks
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)