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

NodeService

Struct NodeService 

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

CSI NodeService implementation.

Implementations§

Source§

impl NodeService

Source

pub const DEFAULT_MAX_VOLUMES: usize = 128usize

Default maximum volumes per node.

Source

pub fn new(node_id: String) -> Self

Create a new node service.

Source

pub fn node_id(&self) -> &str

Get the node ID.

Source

pub fn node_stage_volume( &mut self, volume_id: u64, staging_target: String, device_path: String, fs_type: String, mount_options: Vec<String>, ) -> Result<(), NodeError>

Stage a volume on this node (make the device available).

Source

pub fn node_unstage_volume(&mut self, volume_id: u64) -> Result<(), NodeError>

Unstage a volume (unmount from staging).

Source

pub fn node_publish_volume( &mut self, volume_id: u64, target_path: String, read_only: bool, ) -> Result<(), NodeError>

Publish a volume into a container path (bind mount from staging).

Source

pub fn node_unpublish_volume( &mut self, volume_id: u64, target_path: String, ) -> Result<(), NodeError>

Unpublish a volume from a container path.

Source

pub fn list_staged(&self) -> Vec<&StagedVolume>

List staged volumes.

Source

pub fn list_published(&self) -> Vec<&PublishedVolume>

List published volumes.

Source

pub fn get_staged(&self, volume_id: u64) -> Option<&StagedVolume>

Get staged volume info.

Source

pub fn staged_count(&self) -> usize

Get the number of staged volumes.

Source

pub fn published_count(&self) -> usize

Get the number of published volumes.

Source

pub fn can_accept_volume(&self) -> bool

Check if this node can accept more volumes.

Trait Implementations§

Source§

impl Debug for NodeService

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for NodeService

§

impl RefUnwindSafe for NodeService

§

impl Send for NodeService

§

impl Sync for NodeService

§

impl Unpin for NodeService

§

impl UnwindSafe for NodeService

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.