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

ControllerService

Struct ControllerService 

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

CSI ControllerService implementation.

Implementations§

Source§

impl ControllerService

Source

pub const DEFAULT_CAPACITY: u64 = 107_374_182_400u64

Default total capacity: 100 GB.

Source

pub fn new() -> Self

Create a new controller service.

Source

pub fn with_capacity(total_capacity: u64) -> Self

Create with custom capacity.

Source

pub fn create_volume( &mut self, name: String, capacity_bytes: u64, access_type: AccessType, fs_type: String, access_mode: AccessMode, current_tick: u64, ) -> Result<u64, ControllerError>

Create a new volume.

Source

pub fn delete_volume(&mut self, volume_id: u64) -> Result<(), ControllerError>

Delete a volume.

Source

pub fn get_capacity(&self) -> u64

Get remaining capacity.

Source

pub fn controller_publish( &mut self, volume_id: u64, node_id: String, ) -> Result<(), ControllerError>

Publish a volume to a node (make it available for node operations).

Source

pub fn controller_unpublish( &mut self, volume_id: u64, ) -> Result<(), ControllerError>

Unpublish a volume from a node.

Source

pub fn list_volumes(&self) -> Vec<&Volume>

List all volumes.

Source

pub fn get_volume(&self, volume_id: u64) -> Option<&Volume>

Get volume by ID.

Source

pub fn get_volume_by_name(&self, name: &str) -> Option<&Volume>

Get volume by name.

Source

pub fn validate_capabilities( &self, volume_id: u64, access_mode: AccessMode, ) -> Result<bool, ControllerError>

Validate volume capabilities.

Source

pub fn volume_count(&self) -> usize

Get the total number of volumes.

Trait Implementations§

Source§

impl Debug for ControllerService

Source§

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

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

impl Default for ControllerService

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Freeze for ControllerService

§

impl RefUnwindSafe for ControllerService

§

impl Send for ControllerService

§

impl Sync for ControllerService

§

impl Unpin for ControllerService

§

impl UnwindSafe for ControllerService

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.