Trait containerd_shim::synchronous::Shim
source · pub trait Shim {
type T: Task + Send + Sync;
// Required methods
fn new(runtime_id: &str, args: &Flags, config: &mut Config) -> Self;
fn start_shim(&mut self, opts: StartOpts) -> Result<String>;
fn delete_shim(&mut self) -> Result<DeleteResponse>;
fn wait(&mut self);
fn create_task_service(&self, publisher: RemotePublisher) -> Self::T;
}
Expand description
Main shim interface that must be implemented by all shims.
Start and delete routines will be called to handle containerd’s shim lifecycle requests.
Required Associated Types§
Required Methods§
sourcefn new(runtime_id: &str, args: &Flags, config: &mut Config) -> Self
fn new(runtime_id: &str, args: &Flags, config: &mut Config) -> Self
Create a new instance of Shim.
Arguments
runtime_id
: identifier of the container runtime.args
: command line arguments passed to the shim which includes namespace and idconfig
: for the shim to pass back configuration information
sourcefn start_shim(&mut self, opts: StartOpts) -> Result<String>
fn start_shim(&mut self, opts: StartOpts) -> Result<String>
Start shim will be called by containerd when launching new shim instance.
It expected to return TTRPC address containerd daemon can use to communicate with the given shim instance.
See https://github.com/containerd/containerd/tree/master/runtime/v2#start
sourcefn delete_shim(&mut self) -> Result<DeleteResponse>
fn delete_shim(&mut self) -> Result<DeleteResponse>
Delete shim will be called by containerd after shim shutdown to cleanup any leftovers.
sourcefn create_task_service(&self, publisher: RemotePublisher) -> Self::T
fn create_task_service(&self, publisher: RemotePublisher) -> Self::T
Create the task service object.
Object Safety§
This trait is not object safe.