Struct Drive

Source
pub struct Drive {
    pub name: String,
    pub target: DriveTarget,
    pub mount_path: String,
    pub disk_type: DiskType,
    pub disk_iops_per_gib: Option<usize>,
    pub max_total_size_gib: Option<usize>,
    pub initial_size_gib: usize,
    pub max_bsu_count: usize,
    pub max_used_space_perc: f32,
    pub min_used_space_perc: f32,
    pub disk_scale_factor_perc: f32,
    /* private fields */
}

Fields§

§name: String§target: DriveTarget§mount_path: String§disk_type: DiskType§disk_iops_per_gib: Option<usize>§max_total_size_gib: Option<usize>§initial_size_gib: usize§max_bsu_count: usize§max_used_space_perc: f32§min_used_space_perc: f32§disk_scale_factor_perc: f32

Implementations§

Source§

impl Drive

Source

pub fn new(config: ConfigFileDrive, drive_cmd: Receiver<DriveCmd>) -> Self

Source

pub fn run(&mut self)

Source

pub fn early_exit(&mut self) -> Result<(), Box<dyn Error>>

Source

pub fn reconcile(&mut self) -> Result<(), Box<dyn Error>>

Source

pub fn reconcile_offline(&mut self) -> Result<(), Box<dyn Error>>

Source

pub fn reconcile_delete(&mut self) -> Result<(), Box<dyn Error>>

Source

pub fn reconcile_online(&mut self) -> Result<(), Box<dyn Error>>

Source

pub fn crash_resume(&mut self) -> Result<(), Box<dyn Error>>

Source

pub fn fetch_all_drive_bsu(&mut self) -> Result<(), Box<dyn Error>>

Source

pub fn are_bsu_attached(&mut self) -> Result<bool, Box<dyn Error>>

Source

pub fn bsu_attach_missing(&mut self) -> Result<(), Box<dyn Error>>

Source

pub fn bsu_detach_all_from_this_vm(&mut self) -> Result<(), Box<dyn Error>>

Source

pub fn delete_all_bsu(&mut self) -> Result<(), Box<dyn Error>>

Source

pub fn bsu_count(&mut self) -> usize

Source

pub fn create_initial_bsu(&mut self) -> Result<(), Box<dyn Error>>

Source

pub fn are_pv_initialized(&mut self) -> Result<bool, Box<dyn Error>>

Source

pub fn pv_initialize_missing(&mut self) -> Result<(), Box<dyn Error>>

Source

pub fn is_vg_created(&mut self) -> Result<bool, Box<dyn Error>>

Source

pub fn vg_create(&mut self) -> Result<(), Box<dyn Error>>

Source

pub fn is_vg_extended(&mut self) -> Result<bool, Box<dyn Error>>

Source

pub fn vg_extend(&mut self) -> Result<(), Box<dyn Error>>

Source

pub fn is_lv_created(&mut self) -> Result<bool, Box<dyn Error>>

Source

pub fn lv_create(&mut self) -> Result<(), Box<dyn Error>>

Source

pub fn lv_extend(&mut self) -> Result<(), Box<dyn Error>>

Source

pub fn enable_lv(&mut self) -> Result<(), Box<dyn Error>>

Source

pub fn disable_lv(&mut self) -> Result<(), Box<dyn Error>>

Source

pub fn enable_vg(&mut self) -> Result<(), Box<dyn Error>>

Source

pub fn disable_vg(&mut self) -> Result<(), Box<dyn Error>>

Source

pub fn vg_scan(&self) -> Result<(), Box<dyn Error>>

Source

pub fn is_fs_formated(&mut self) -> Result<bool, Box<dyn Error>>

Source

pub fn fs_format(&mut self) -> Result<(), Box<dyn Error>>

Source

pub fn is_mount_path_created(&mut self) -> bool

Source

pub fn create_mount_path(&mut self) -> Result<(), Box<dyn Error>>

Source

pub fn is_fs_mounted(&mut self) -> Result<bool, Box<dyn Error>>

Source

pub fn fs_mount(&mut self) -> Result<(), Box<dyn Error>>

Source

pub fn fs_umount(&mut self) -> Result<(), Box<dyn Error>>

Source

pub fn is_fs_extended(&mut self) -> Result<bool, Box<dyn Error>>

Source

pub fn fs_extend(&mut self) -> Result<(), Box<dyn Error>>

Source

pub fn is_drive_reached_max_attached_bsu( &mut self, ) -> Result<bool, Box<dyn Error>>

Source

pub fn is_drive_reached_max_attached_bsu_minus_one( &mut self, ) -> Result<bool, Box<dyn Error>>

Source

pub fn is_drive_contains_smallest_bsu(&mut self) -> bool

Source

pub fn remove_smallest_bsu(&mut self) -> Result<(), Box<dyn Error>>

Source

pub fn is_drive_low_space_left(&mut self) -> Result<bool, Box<dyn Error>>

Source

pub fn is_max_space_reached(&mut self) -> bool

Source

pub fn all_bsu_size_gib(&self) -> usize

Source

pub fn create_larger_bsu(&mut self) -> Result<(), Box<dyn Error>>

Source

pub fn create_smaller_bsu(&mut self) -> Result<(), Box<dyn Error>>

Source

pub fn largest_bsu(&self) -> Bsu

Source

pub fn smallest_bsu(&self) -> Bsu

Source

pub fn is_drive_high_space_left(&mut self) -> Result<bool, Box<dyn Error>>

Source

pub fn has_minimal_size(&self) -> bool

Source

pub fn ideal_size_bytes(&mut self) -> Result<usize, Box<dyn Error>>

Source

pub fn create_ideal_bsu(&mut self) -> Result<(), Box<dyn Error>>

Source

pub fn remove_largest_bsu(&mut self) -> Result<(), Box<dyn Error>>

Source

pub fn remove_bsu(&mut self, bsu: &Bsu) -> Result<(), Box<dyn Error>>

Trait Implementations§

Source§

impl Debug for Drive

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Drive

§

impl RefUnwindSafe for Drive

§

impl Send for Drive

§

impl !Sync for Drive

§

impl Unpin for Drive

§

impl UnwindSafe for Drive

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Err = <U as TryFrom<T>>::Err

Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Err>

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,