pub struct Drive<B: Bmc> { /* private fields */ }Expand description
Represents a drive (disk) in a storage controller.
Provides access to drive information and associated metrics/sensors.
Implementations§
Source§impl<B: Bmc> Drive<B>
impl<B: Bmc> Drive<B>
Sourcepub fn raw(&self) -> Arc<DriveSchema> ⓘ
pub fn raw(&self) -> Arc<DriveSchema> ⓘ
Get the raw schema data for this drive.
Returns an Arc to the underlying schema, allowing cheap cloning
and sharing of the data.
Sourcepub async fn metrics(&self) -> Result<Option<Arc<DriveMetrics>>, Error<B>>
pub async fn metrics(&self) -> Result<Option<Arc<DriveMetrics>>, Error<B>>
Get drive metrics.
Returns the drive’s performance and state metrics if available.
§Errors
Returns an error if:
- The drive does not have metrics
- Fetching metrics data fails
Sourcepub async fn environment_sensor_links(
&self,
) -> Result<Vec<SensorLink<B>>, Error<B>>
pub async fn environment_sensor_links( &self, ) -> Result<Vec<SensorLink<B>>, Error<B>>
Get the environment sensors for this drive.
Returns a vector of Sensor<B> obtained from environment metrics, if available.
§Errors
Returns an error if get of environment metrics failed.
Sourcepub async fn environment_power_limit_control(
&self,
) -> Result<Option<Control<B>>, Error<B>>
pub async fn environment_power_limit_control( &self, ) -> Result<Option<Control<B>>, Error<B>>
Get the environment power limit control for this drive.
Returns Ok(None) when environment metrics or PowerLimitWatts is absent.
§Errors
Returns an error if fetching environment metrics or the control fails.
Trait Implementations§
Source§impl<B: Bmc> Resource for Drive<B>
impl<B: Bmc> Resource for Drive<B>
Source§fn resource_ref(&self) -> &ResourceSchema
fn resource_ref(&self) -> &ResourceSchema
Required function. Must be implemented for Redfish resources.
Source§fn id(&self) -> ResourceIdRef<'_>
fn id(&self) -> ResourceIdRef<'_>
Identifier of the resource.
Source§fn name(&self) -> ResourceNameRef<'_>
fn name(&self) -> ResourceNameRef<'_>
Name of the resource.
Source§fn description(&self) -> Option<ResourceDescriptionRef<'_>>
fn description(&self) -> Option<ResourceDescriptionRef<'_>>
Description of the resource.
Auto Trait Implementations§
impl<B> Freeze for Drive<B>
impl<B> RefUnwindSafe for Drive<B>where
B: RefUnwindSafe,
impl<B> Send for Drive<B>
impl<B> Sync for Drive<B>
impl<B> Unpin for Drive<B>
impl<B> UnsafeUnpin for Drive<B>
impl<B> UnwindSafe for Drive<B>where
B: RefUnwindSafe,
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