⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

RuntimeService

Struct RuntimeService 

Source
pub struct RuntimeService { /* private fields */ }
Expand description

CRI RuntimeService implementation.

Implementations§

Source§

impl RuntimeService

Source

pub fn new() -> Self

Create a new runtime service.

Source

pub fn run_pod_sandbox( &mut self, name: String, namespace: String, network_config: NetworkConfig, current_tick: u64, ) -> Result<u64, CriError>

Create and start a pod sandbox.

Source

pub fn stop_pod_sandbox(&mut self, sandbox_id: u64) -> Result<(), CriError>

Stop a running pod sandbox.

Source

pub fn remove_pod_sandbox(&mut self, sandbox_id: u64) -> Result<(), CriError>

Remove a stopped pod sandbox.

Source

pub fn pod_sandbox_status( &self, sandbox_id: u64, ) -> Result<&PodSandbox, CriError>

Get pod sandbox status.

Source

pub fn list_pod_sandboxes( &self, state_filter: Option<PodSandboxState>, ) -> Vec<&PodSandbox>

List pod sandboxes, optionally filtered by state.

Source

pub fn create_container( &mut self, pod_sandbox_id: u64, name: String, image: String, command: Vec<String>, args: Vec<String>, env: Vec<String>, ) -> Result<u64, CriError>

Create a container within a pod sandbox.

Source

pub fn start_container( &mut self, container_id: u64, current_tick: u64, ) -> Result<(), CriError>

Start a created container.

Source

pub fn stop_container( &mut self, container_id: u64, current_tick: u64, ) -> Result<(), CriError>

Stop a running container.

Source

pub fn remove_container(&mut self, container_id: u64) -> Result<(), CriError>

Remove a stopped container.

Source

pub fn container_status( &self, container_id: u64, ) -> Result<ContainerStatus, CriError>

Get container status.

Source

pub fn list_containers( &self, state_filter: Option<ContainerState>, sandbox_filter: Option<u64>, ) -> Vec<&Container>

List containers, optionally filtered by state and/or sandbox.

Source

pub fn sandbox_count(&self) -> usize

Get the total number of sandboxes.

Source

pub fn container_count(&self) -> usize

Get the total number of containers.

Trait Implementations§

Source§

impl Debug for RuntimeService

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RuntimeService

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for RuntimeService

§

impl RefUnwindSafe for RuntimeService

§

impl Send for RuntimeService

§

impl Sync for RuntimeService

§

impl Unpin for RuntimeService

§

impl UnwindSafe for RuntimeService

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.