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
impl Drive
pub fn new(config: ConfigFileDrive, drive_cmd: Receiver<DriveCmd>) -> Self
pub fn run(&mut self)
pub fn early_exit(&mut self) -> Result<(), Box<dyn Error>>
pub fn reconcile(&mut self) -> Result<(), Box<dyn Error>>
pub fn reconcile_offline(&mut self) -> Result<(), Box<dyn Error>>
pub fn reconcile_delete(&mut self) -> Result<(), Box<dyn Error>>
pub fn reconcile_online(&mut self) -> Result<(), Box<dyn Error>>
pub fn crash_resume(&mut self) -> Result<(), Box<dyn Error>>
pub fn fetch_all_drive_bsu(&mut self) -> Result<(), Box<dyn Error>>
pub fn are_bsu_attached(&mut self) -> Result<bool, Box<dyn Error>>
pub fn bsu_attach_missing(&mut self) -> Result<(), Box<dyn Error>>
pub fn bsu_detach_all_from_this_vm(&mut self) -> Result<(), Box<dyn Error>>
pub fn delete_all_bsu(&mut self) -> Result<(), Box<dyn Error>>
pub fn bsu_count(&mut self) -> usize
pub fn create_initial_bsu(&mut self) -> Result<(), Box<dyn Error>>
pub fn are_pv_initialized(&mut self) -> Result<bool, Box<dyn Error>>
pub fn pv_initialize_missing(&mut self) -> Result<(), Box<dyn Error>>
pub fn is_vg_created(&mut self) -> Result<bool, Box<dyn Error>>
pub fn vg_create(&mut self) -> Result<(), Box<dyn Error>>
pub fn is_vg_extended(&mut self) -> Result<bool, Box<dyn Error>>
pub fn vg_extend(&mut self) -> Result<(), Box<dyn Error>>
pub fn is_lv_created(&mut self) -> Result<bool, Box<dyn Error>>
pub fn lv_create(&mut self) -> Result<(), Box<dyn Error>>
pub fn lv_extend(&mut self) -> Result<(), Box<dyn Error>>
pub fn enable_lv(&mut self) -> Result<(), Box<dyn Error>>
pub fn disable_lv(&mut self) -> Result<(), Box<dyn Error>>
pub fn enable_vg(&mut self) -> Result<(), Box<dyn Error>>
pub fn disable_vg(&mut self) -> Result<(), Box<dyn Error>>
pub fn vg_scan(&self) -> Result<(), Box<dyn Error>>
pub fn is_fs_formated(&mut self) -> Result<bool, Box<dyn Error>>
pub fn fs_format(&mut self) -> Result<(), Box<dyn Error>>
pub fn is_mount_path_created(&mut self) -> bool
pub fn create_mount_path(&mut self) -> Result<(), Box<dyn Error>>
pub fn is_fs_mounted(&mut self) -> Result<bool, Box<dyn Error>>
pub fn fs_mount(&mut self) -> Result<(), Box<dyn Error>>
pub fn fs_umount(&mut self) -> Result<(), Box<dyn Error>>
pub fn is_fs_extended(&mut self) -> Result<bool, Box<dyn Error>>
pub fn fs_extend(&mut self) -> Result<(), Box<dyn Error>>
pub fn is_drive_reached_max_attached_bsu( &mut self, ) -> Result<bool, Box<dyn Error>>
pub fn is_drive_reached_max_attached_bsu_minus_one( &mut self, ) -> Result<bool, Box<dyn Error>>
pub fn is_drive_contains_smallest_bsu(&mut self) -> bool
pub fn remove_smallest_bsu(&mut self) -> Result<(), Box<dyn Error>>
pub fn is_drive_low_space_left(&mut self) -> Result<bool, Box<dyn Error>>
pub fn is_max_space_reached(&mut self) -> bool
pub fn all_bsu_size_gib(&self) -> usize
pub fn create_larger_bsu(&mut self) -> Result<(), Box<dyn Error>>
pub fn create_smaller_bsu(&mut self) -> Result<(), Box<dyn Error>>
pub fn largest_bsu(&self) -> Bsu
pub fn smallest_bsu(&self) -> Bsu
pub fn is_drive_high_space_left(&mut self) -> Result<bool, Box<dyn Error>>
pub fn has_minimal_size(&self) -> bool
pub fn ideal_size_bytes(&mut self) -> Result<usize, Box<dyn Error>>
pub fn create_ideal_bsu(&mut self) -> Result<(), Box<dyn Error>>
pub fn remove_largest_bsu(&mut self) -> Result<(), Box<dyn Error>>
pub fn remove_bsu(&mut self, bsu: &Bsu) -> Result<(), Box<dyn Error>>
Trait Implementations§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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