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

OciContainer

Struct OciContainer 

Source
pub struct OciContainer {
    pub id: String,
    pub state: OciLifecycleState,
    pub config: OciConfig,
    pub pid: u64,
    pub bundle: String,
    pub created_at: u64,
}
Expand description

An OCI-compliant container runtime instance.

Fields§

§id: String

Unique container ID.

§state: OciLifecycleState

Current lifecycle state.

§config: OciConfig

Parsed OCI configuration.

§pid: u64

PID of the container init process (0 if not started).

§bundle: String

Bundle path (directory containing config.json + rootfs).

§created_at: u64

Creation timestamp (monotonic counter value).

Implementations§

Source§

impl OciContainer

Source

pub fn new( id: &str, bundle: &str, config: OciConfig, ) -> Result<Self, KernelError>

Create a new container from a parsed config.

Source

pub fn mark_created(&mut self) -> Result<(), KernelError>

Transition to Created state (namespaces set up, hooks run).

Source

pub fn start(&mut self, pid: u64) -> Result<(), KernelError>

Start the container process, transitioning to Running.

Source

pub fn stop(&mut self) -> Result<(), KernelError>

Transition to Stopped state.

Source

pub fn pivot_root(&self) -> Result<(String, String), KernelError>

Perform pivot_root: change the root filesystem for the container. Returns the old root path and new root path.

Trait Implementations§

Source§

impl Debug for OciContainer

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for OciContainer

§

impl RefUnwindSafe for OciContainer

§

impl Send for OciContainer

§

impl Sync for OciContainer

§

impl Unpin for OciContainer

§

impl UnwindSafe for OciContainer

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.