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.
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>,
source§impl PartialEq for Hooks
impl PartialEq for Hooks
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)