lsm

Struct Disk

source
pub struct Disk {
    pub id: String,
    pub name: String,
    pub disk_type: DiskType,
    pub block_size: u64,
    pub num_of_blocks: u64,
    pub status: u64,
    pub system_id: String,
    pub location: Option<String>,
    pub rpm: Option<i32>,
    pub link_type: Option<DiskLinkType>,
    pub vpd83: Option<String>,
    /* private fields */
}

Fields§

§id: String

Identifier.

§name: String

Human friendly name.

§disk_type: DiskType

Disk type.

§block_size: u64

Block size in bytes.

§num_of_blocks: u64

Count of block.

§status: u64§system_id: String

Identifier of owner system.

§location: Option<String>

Disk location in storage topology.

§rpm: Option<i32>

Disk rotation speed - revolutions per minute(RPM):

  • -1 – Unknown RPM speed.

  • 0 – Non-rotating medium (e.g., SSD).

  • 1 – Rotational disk with unknown speed.

  • > 1 – Normal rotational disk (e.g., HDD).

§link_type: Option<DiskLinkType>

Disk data link type.

§vpd83: Option<String>

SCSI VPD 0x83 NAA type identifier. Udev treat it as ID_WWN_WITH_EXTENSION

Implementations§

source§

impl Disk

source

pub const STATUS_UNKNOWN: u64 = 1u64

Plugin failed to query out the status of disk.

source

pub const STATUS_OK: u64 = 2u64

Disk is up and healthy.

source

pub const STATUS_OTHER: u64 = 4u64

Vendor specific status.

source

pub const STATUS_PREDICTIVE_FAILURE: u64 = 8u64

Disk is still functional but will fail soon.

source

pub const STATUS_ERROR: u64 = 16u64

Error make disk not functional.

source

pub const STATUS_REMOVED: u64 = 32u64

Disk was removed by administrator.

source

pub const STATUS_STARTING: u64 = 64u64

Disk is starting up.

source

pub const STATUS_STOPPING: u64 = 128u64

Disk is shutting down.

source

pub const STATUS_STOPPED: u64 = 256u64

Disk is stopped by administrator.

source

pub const STATUS_INITIALIZING: u64 = 512u64

Disk is not functional yet, internal storage system is initializing this disk, it could be:

  • Initialising new disk.

  • Zeroing disk.

  • Scrubbing disk data.

source

pub const STATUS_MAINTENANCE_MODE: u64 = 1_024u64

In maintenance for bad sector scan, integrity check and etc It might be combined with Disk::STATUS_OK or Disk::STATUS_STOPPED for online maintenance or offline maintenance.

source

pub const STATUS_SPARE_DISK: u64 = 2_048u64

Disk is configured as spare disk.

source

pub const STATUS_RECONSTRUCT: u64 = 4_096u64

Disk is reconstructing its data.

source

pub const STATUS_FREE: u64 = 8_192u64

Indicate the whole disk is not holding any data or acting as a dedicate spare disk. This disk could be assigned as a dedicated spare disk or used for creating pool. If any spare disk(like those on NetApp ONTAP) does not require any explicit action when assigning to pool, it should be treated as free disk and marked as Disk::STATUS_FREE | Disk::STATUS_SPARE_DISK.

Trait Implementations§

source§

impl Clone for Disk

source§

fn clone(&self) -> Disk

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Disk

source§

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

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

impl<'de> Deserialize<'de> for Disk

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for Disk

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Disk

§

impl RefUnwindSafe for Disk

§

impl Send for Disk

§

impl Sync for Disk

§

impl Unpin for Disk

§

impl UnwindSafe for Disk

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> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,