Skip to main content

Features

Struct Features 

Source
pub struct Features<'a, 'r> { /* private fields */ }
Expand description

Get/Set Features accessor for a controller.

Created by Controller::features. Borrows the controller; all methods require the controller’s /dev/nvmeN to be openable (root or disk group on most distros).

Implementations§

Source§

impl Features<'_, '_>

Source

pub fn get_arbitration(&self, sel: FeatureSelect) -> Result<u32>

Get Features — Arbitration (FID 01h).

Source

pub fn get_power_mgmt(&self, sel: FeatureSelect) -> Result<u32>

Get Features — Power Management (FID 02h).

Source

pub fn get_lba_range( &self, sel: FeatureSelect, data: &mut LbaRangeType, ) -> Result<u32>

Get Features — LBA Range Type (FID 03h).

Source

pub fn get_lba_range2( &self, sel: FeatureSelect, nsid: u32, data: &mut LbaRangeType, ) -> Result<u32>

Get Features — LBA Range Type (FID 03h), NSID-scoped extended form.

Source

pub fn get_temp_thresh(&self, sel: FeatureSelect) -> Result<u32>

Get Features — Temperature Threshold (FID 04h).

Source

pub fn get_temp_thresh2( &self, sel: FeatureSelect, tmpsel: u8, thsel: u32, ) -> Result<u32>

Get Features — Temperature Threshold (FID 04h), extended form.

Source

pub fn get_err_recovery(&self, sel: FeatureSelect) -> Result<u32>

Get Features — Error Recovery (FID 05h).

Source

pub fn get_err_recovery2(&self, sel: FeatureSelect, nsid: u32) -> Result<u32>

Get Features — Error Recovery (FID 05h), NSID-scoped extended form.

Source

pub fn get_volatile_wc(&self, sel: FeatureSelect) -> Result<u32>

Get Features — Volatile Write Cache (FID 06h).

Source

pub fn get_num_queues(&self, sel: FeatureSelect) -> Result<u32>

Get Features — Number of Queues (FID 07h).

Source

pub fn get_irq_coalesce(&self, sel: FeatureSelect) -> Result<u32>

Get Features — Interrupt Coalescing (FID 08h).

Source

pub fn get_irq_config(&self, sel: FeatureSelect, iv: u16) -> Result<u32>

Get Features — Interrupt Vector Configuration (FID 09h).

Source

pub fn get_write_atomic(&self, sel: FeatureSelect) -> Result<u32>

Get Features — Write Atomicity Normal (FID 0Ah).

Source

pub fn get_async_event(&self, sel: FeatureSelect) -> Result<u32>

Get Features — Async Event Configuration (FID 0Bh).

Source

pub fn get_auto_pst( &self, sel: FeatureSelect, apst: &mut AutoPst, ) -> Result<u32>

Get Features — Auto Power State Transition (FID 0Ch).

Source

pub fn get_host_mem_buf(&self, sel: FeatureSelect) -> Result<u32>

Get Features — Host Memory Buffer (FID 0Dh).

Source

pub fn get_host_mem_buf2( &self, sel: FeatureSelect, attrs: &mut HostMemBufAttrs, ) -> Result<u32>

Get Features — Host Memory Buffer (FID 0Dh), extended form returning the full attributes struct.

Source

pub fn get_timestamp( &self, sel: FeatureSelect, ts: &mut Timestamp, ) -> Result<()>

Get Features — Timestamp (FID 0Eh).

Source

pub fn get_kato(&self, sel: FeatureSelect) -> Result<u32>

Get Features — Keep Alive Timer (FID 0Fh).

Source

pub fn get_hctm(&self, sel: FeatureSelect) -> Result<u32>

Get Features — Host Controlled Thermal Management (FID 10h).

Source

pub fn get_nopsc(&self, sel: FeatureSelect) -> Result<u32>

Get Features — Non-Operational Power State Config (FID 11h).

Source

pub fn get_rrl(&self, sel: FeatureSelect) -> Result<u32>

Get Features — Read Recovery Level (FID 12h).

Source

pub fn get_plm_config( &self, sel: FeatureSelect, nvmsetid: u16, data: &mut PlmConfig, ) -> Result<u32>

Get Features — Predictable Latency Mode Config (FID 13h).

Source

pub fn get_plm_window(&self, sel: FeatureSelect, nvmsetid: u16) -> Result<u32>

Get Features — Predictable Latency Mode Window (FID 14h).

Source

pub fn get_lba_sts_interval(&self, sel: FeatureSelect) -> Result<u32>

Get Features — LBA Status Information Report Interval (FID 15h).

Source

pub fn get_host_behavior( &self, sel: FeatureSelect, data: &mut HostBehavior, ) -> Result<u32>

Get Features — Host Behavior Support (FID 16h).

Source

pub fn get_sanitize(&self, sel: FeatureSelect) -> Result<u32>

Get Features — Sanitize Config (FID 17h).

Source

pub fn get_endurance_event_cfg( &self, sel: FeatureSelect, endgid: u16, ) -> Result<u32>

Get Features — Endurance Group Event Configuration (FID 18h).

Source

pub fn get_sw_progress(&self, sel: FeatureSelect) -> Result<u32>

Get Features — Software Progress Marker (FID 80h).

Source

pub fn get_host_id( &self, sel: FeatureSelect, exhid: bool, hostid: &mut [u8], ) -> Result<()>

Get Features — Host Identifier (FID 81h).

hostid must be exactly 8 bytes when exhid is false, or 16 bytes when exhid is true.

Source

pub fn get_resv_mask(&self, sel: FeatureSelect) -> Result<u32>

Get Features — Reservation Notification Mask (FID 82h).

Source

pub fn get_resv_mask2(&self, sel: FeatureSelect, nsid: u32) -> Result<u32>

Get Features — Reservation Notification Mask (FID 82h), NSID-scoped extended form.

Source

pub fn get_resv_persist(&self, sel: FeatureSelect) -> Result<u32>

Get Features — Reservation Persistence (FID 83h).

Source

pub fn get_resv_persist2(&self, sel: FeatureSelect, nsid: u32) -> Result<u32>

Get Features — Reservation Persistence (FID 83h), NSID-scoped extended form.

Source

pub fn get_write_protect(&self, sel: FeatureSelect, nsid: u32) -> Result<u32>

Get Features — Namespace Write Protection (FID 84h).

Source

pub fn get_iocs_profile(&self, sel: FeatureSelect) -> Result<u32>

Get Features — IO Command Set Profile (FID 19h, NVMe 2.0).

Source§

impl Features<'_, '_>

Source

pub fn set_arbitration( &self, ab: u8, lpw: u8, mpw: u8, hpw: u8, save: bool, ) -> Result<u32>

Set Features — Arbitration (FID 01h).

Source

pub fn set_power_mgmt(&self, ps: u8, wh: u8, save: bool) -> Result<u32>

Set Features — Power Management (FID 02h).

Source

pub fn set_lba_range( &self, nsid: u32, nr_ranges: u8, save: bool, data: &mut LbaRangeType, ) -> Result<u32>

Set Features — LBA Range Type (FID 03h).

Source

pub fn set_temp_thresh( &self, tmpth: u16, tmpsel: u8, thsel: u32, save: bool, ) -> Result<u32>

Set Features — Temperature Threshold (FID 04h).

Source

pub fn set_temp_thresh2( &self, tmpth: u16, tmpsel: u8, thsel: u32, tmpthh: u8, save: bool, ) -> Result<u32>

Set Features — Temperature Threshold (FID 04h), extended form with an upper temperature byte.

Available on libnvme builds that expose nvme_set_features_temp_thresh2.

Source

pub fn set_err_recovery( &self, nsid: u32, tler: u16, dulbe: bool, save: bool, ) -> Result<u32>

Set Features — Error Recovery (FID 05h).

Source

pub fn set_volatile_wc(&self, wce: bool, save: bool) -> Result<u32>

Set Features — Volatile Write Cache (FID 06h).

Source

pub fn set_irq_coalesce(&self, thr: u8, time: u8, save: bool) -> Result<u32>

Set Features — Interrupt Coalescing (FID 08h).

Source

pub fn set_irq_config(&self, iv: u16, cd: bool, save: bool) -> Result<u32>

Set Features — Interrupt Vector Configuration (FID 09h).

Source

pub fn set_write_atomic(&self, dn: bool, save: bool) -> Result<u32>

Set Features — Write Atomicity Normal (FID 0Ah).

Source

pub fn set_async_event(&self, events: u32, save: bool) -> Result<u32>

Set Features — Async Event Configuration (FID 0Bh).

Source

pub fn set_auto_pst( &self, apste: bool, save: bool, apst: &mut AutoPst, ) -> Result<u32>

Set Features — Auto Power State Transition (FID 0Ch).

Source

pub fn set_timestamp(&self, save: bool, timestamp: u64) -> Result<()>

Set Features — Host Memory Buffer (FID 0Dh) — sub-command via Timestamp.

(libnvme exposes Timestamp as its own setter; see Self::set_timestamp.)

Source

pub fn set_hctm(&self, tmt2: u16, tmt1: u16, save: bool) -> Result<u32>

Set Features — Host Controlled Thermal Management (FID 10h).

Source

pub fn set_nopsc(&self, noppme: bool, save: bool) -> Result<u32>

Set Features — Non-Operational Power State Config (FID 11h).

Source

pub fn set_rrl(&self, rrl: u8, nvmsetid: u16, save: bool) -> Result<u32>

Set Features — Read Recovery Level (FID 12h).

Source

pub fn set_plm_config( &self, enable: bool, nvmsetid: u16, save: bool, data: &mut PlmConfig, ) -> Result<u32>

Set Features — Predictable Latency Mode Config (FID 13h).

Source

pub fn set_plm_window(&self, sel: u32, nvmsetid: u16, save: bool) -> Result<u32>

Set Features — Predictable Latency Mode Window (FID 14h).

Source

pub fn set_lba_sts_interval( &self, lsiri: u16, lsipi: u16, save: bool, ) -> Result<u32>

Set Features — LBA Status Information Report Interval (FID 15h).

Source

pub fn set_host_behavior( &self, save: bool, data: &mut HostBehavior, ) -> Result<()>

Set Features — Host Behavior Support (FID 16h).

Source

pub fn set_sanitize(&self, nodrm: bool, save: bool) -> Result<u32>

Set Features — Sanitize Config (FID 17h).

Source

pub fn set_endurance_evt_cfg( &self, endgid: u16, egwarn: u8, save: bool, ) -> Result<u32>

Set Features — Endurance Group Event Configuration (FID 18h).

Source

pub fn set_sw_progress(&self, pbslc: u8, save: bool) -> Result<u32>

Set Features — Software Progress Marker (FID 80h).

Source

pub fn set_host_id( &self, exhid: bool, save: bool, hostid: &mut [u8], ) -> Result<()>

Set Features — Host Identifier (FID 81h).

hostid must be exactly 8 bytes when exhid is false, or 16 bytes when exhid is true.

Source

pub fn set_resv_mask(&self, mask: u32, save: bool) -> Result<u32>

Set Features — Reservation Notification Mask (FID 82h).

Source

pub fn set_resv_mask2(&self, nsid: u32, mask: u32, save: bool) -> Result<u32>

Set Features — Reservation Notification Mask (FID 82h), NSID-scoped extended form. Available on libnvme builds that expose nvme_set_features_resv_mask2.

Source

pub fn set_resv_persist(&self, ptpl: bool, save: bool) -> Result<u32>

Set Features — Reservation Persistence (FID 83h).

Source

pub fn set_resv_persist2( &self, nsid: u32, ptpl: bool, save: bool, ) -> Result<u32>

Set Features — Reservation Persistence (FID 83h), NSID-scoped extended form. Available on libnvme builds that expose nvme_set_features_resv_persist2.

Source

pub fn set_write_protect(&self, state: u32, save: bool) -> Result<u32>

Set Features — Namespace Write Protection (FID 84h).

Source

pub fn set_write_protect2( &self, nsid: u32, state: u32, save: bool, ) -> Result<u32>

Set Features — Namespace Write Protection (FID 84h), NSID-scoped extended form. Available on libnvme builds that expose nvme_set_features_write_protect2.

Source

pub fn set_iocs_profile(&self, iocsi: u16, save: bool) -> Result<()>

Set Features — IO Command Set Profile (FID 19h, NVMe 2.0).

Auto Trait Implementations§

§

impl<'a, 'r> Freeze for Features<'a, 'r>

§

impl<'a, 'r> RefUnwindSafe for Features<'a, 'r>

§

impl<'a, 'r> !Send for Features<'a, 'r>

§

impl<'a, 'r> !Sync for Features<'a, 'r>

§

impl<'a, 'r> Unpin for Features<'a, 'r>

§

impl<'a, 'r> UnsafeUnpin for Features<'a, 'r>

§

impl<'a, 'r> UnwindSafe for Features<'a, 'r>

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, 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, 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.