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

SnapshotService

Struct SnapshotService 

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

CSI Snapshot Service implementation.

Implementations§

Source§

impl SnapshotService

Source

pub fn new() -> Self

Create a new snapshot service.

Source

pub fn register_volume(&mut self, volume_id: u64, capacity_bytes: u64)

Register a known volume (for snapshot source validation).

Source

pub fn unregister_volume(&mut self, volume_id: u64)

Unregister a volume.

Source

pub fn create_snapshot( &mut self, name: String, source_volume_id: u64, current_tick: u64, ) -> Result<u64, SnapshotError>

Create a COW snapshot of a volume.

Source

pub fn delete_snapshot(&mut self, snapshot_id: u64) -> Result<(), SnapshotError>

Delete a snapshot.

Source

pub fn list_snapshots(&self, source_filter: Option<u64>) -> Vec<&Snapshot>

List all snapshots, optionally filtered by source volume.

Source

pub fn get_snapshot(&self, snapshot_id: u64) -> Option<&Snapshot>

Get snapshot by ID.

Source

pub fn get_snapshot_by_name(&self, name: &str) -> Option<&Snapshot>

Get snapshot by name.

Source

pub fn snapshot_count(&self) -> usize

Get the total number of snapshots.

Trait Implementations§

Source§

impl Debug for SnapshotService

Source§

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

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

impl Default for SnapshotService

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Freeze for SnapshotService

§

impl RefUnwindSafe for SnapshotService

§

impl Send for SnapshotService

§

impl Sync for SnapshotService

§

impl Unpin for SnapshotService

§

impl UnwindSafe for SnapshotService

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.