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

ImageService

Struct ImageService 

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

CRI ImageService implementation.

Implementations§

Source§

impl ImageService

Source

pub const DEFAULT_MAX_STORAGE: u64 = 10_737_418_240u64

Default maximum image storage: 10 GB.

Source

pub fn new() -> Self

Create a new image service.

Source

pub fn with_max_storage(max_storage: u64) -> Self

Create with a custom storage limit.

Source

pub fn pull_image( &mut self, spec: ImageSpec, _auth: Option<AuthConfig>, current_tick: u64, ) -> Result<u64, ImageError>

Pull an image from a registry.

In the kernel environment this is a conceptual operation that registers the image metadata. Actual layer download would go through the network stack and filesystem.

Source

pub fn list_images(&self) -> Vec<&ImageStatus>

List all images.

Source

pub fn image_status(&self, image_id: u64) -> Option<&ImageStatus>

Get image status by ID.

Source

pub fn image_status_by_ref(&self, reference: &str) -> Option<&ImageStatus>

Get image status by reference string.

Source

pub fn remove_image(&mut self, image_id: u64) -> Result<(), ImageError>

Remove an image.

Source

pub fn remove_image_by_ref(&mut self, reference: &str) -> Result<(), ImageError>

Remove an image by reference string.

Source

pub fn image_count(&self) -> usize

Get the total number of images.

Source

pub fn used_storage(&self) -> u64

Get total storage used.

Source

pub fn available_storage(&self) -> u64

Get available storage.

Trait Implementations§

Source§

impl Debug for ImageService

Source§

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

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

impl Default for ImageService

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Freeze for ImageService

§

impl RefUnwindSafe for ImageService

§

impl Send for ImageService

§

impl Sync for ImageService

§

impl Unpin for ImageService

§

impl UnwindSafe for ImageService

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.