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<'_, '_>
impl Features<'_, '_>
Sourcepub fn get_arbitration(&self, sel: FeatureSelect) -> Result<u32>
pub fn get_arbitration(&self, sel: FeatureSelect) -> Result<u32>
Get Features — Arbitration (FID 01h).
Sourcepub fn get_power_mgmt(&self, sel: FeatureSelect) -> Result<u32>
pub fn get_power_mgmt(&self, sel: FeatureSelect) -> Result<u32>
Get Features — Power Management (FID 02h).
Sourcepub fn get_lba_range(
&self,
sel: FeatureSelect,
data: &mut LbaRangeType,
) -> Result<u32>
pub fn get_lba_range( &self, sel: FeatureSelect, data: &mut LbaRangeType, ) -> Result<u32>
Get Features — LBA Range Type (FID 03h).
Sourcepub fn get_lba_range2(
&self,
sel: FeatureSelect,
nsid: u32,
data: &mut LbaRangeType,
) -> Result<u32>
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.
Sourcepub fn get_temp_thresh(&self, sel: FeatureSelect) -> Result<u32>
pub fn get_temp_thresh(&self, sel: FeatureSelect) -> Result<u32>
Get Features — Temperature Threshold (FID 04h).
Sourcepub fn get_temp_thresh2(
&self,
sel: FeatureSelect,
tmpsel: u8,
thsel: u32,
) -> Result<u32>
pub fn get_temp_thresh2( &self, sel: FeatureSelect, tmpsel: u8, thsel: u32, ) -> Result<u32>
Get Features — Temperature Threshold (FID 04h), extended form.
Sourcepub fn get_err_recovery(&self, sel: FeatureSelect) -> Result<u32>
pub fn get_err_recovery(&self, sel: FeatureSelect) -> Result<u32>
Get Features — Error Recovery (FID 05h).
Sourcepub fn get_err_recovery2(&self, sel: FeatureSelect, nsid: u32) -> Result<u32>
pub fn get_err_recovery2(&self, sel: FeatureSelect, nsid: u32) -> Result<u32>
Get Features — Error Recovery (FID 05h), NSID-scoped extended form.
Sourcepub fn get_volatile_wc(&self, sel: FeatureSelect) -> Result<u32>
pub fn get_volatile_wc(&self, sel: FeatureSelect) -> Result<u32>
Get Features — Volatile Write Cache (FID 06h).
Sourcepub fn get_num_queues(&self, sel: FeatureSelect) -> Result<u32>
pub fn get_num_queues(&self, sel: FeatureSelect) -> Result<u32>
Get Features — Number of Queues (FID 07h).
Sourcepub fn get_irq_coalesce(&self, sel: FeatureSelect) -> Result<u32>
pub fn get_irq_coalesce(&self, sel: FeatureSelect) -> Result<u32>
Get Features — Interrupt Coalescing (FID 08h).
Sourcepub fn get_irq_config(&self, sel: FeatureSelect, iv: u16) -> Result<u32>
pub fn get_irq_config(&self, sel: FeatureSelect, iv: u16) -> Result<u32>
Get Features — Interrupt Vector Configuration (FID 09h).
Sourcepub fn get_write_atomic(&self, sel: FeatureSelect) -> Result<u32>
pub fn get_write_atomic(&self, sel: FeatureSelect) -> Result<u32>
Get Features — Write Atomicity Normal (FID 0Ah).
Sourcepub fn get_async_event(&self, sel: FeatureSelect) -> Result<u32>
pub fn get_async_event(&self, sel: FeatureSelect) -> Result<u32>
Get Features — Async Event Configuration (FID 0Bh).
Sourcepub fn get_auto_pst(
&self,
sel: FeatureSelect,
apst: &mut AutoPst,
) -> Result<u32>
pub fn get_auto_pst( &self, sel: FeatureSelect, apst: &mut AutoPst, ) -> Result<u32>
Get Features — Auto Power State Transition (FID 0Ch).
Sourcepub fn get_host_mem_buf(&self, sel: FeatureSelect) -> Result<u32>
pub fn get_host_mem_buf(&self, sel: FeatureSelect) -> Result<u32>
Get Features — Host Memory Buffer (FID 0Dh).
Sourcepub fn get_host_mem_buf2(
&self,
sel: FeatureSelect,
attrs: &mut HostMemBufAttrs,
) -> Result<u32>
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.
Sourcepub fn get_timestamp(
&self,
sel: FeatureSelect,
ts: &mut Timestamp,
) -> Result<()>
pub fn get_timestamp( &self, sel: FeatureSelect, ts: &mut Timestamp, ) -> Result<()>
Get Features — Timestamp (FID 0Eh).
Sourcepub fn get_kato(&self, sel: FeatureSelect) -> Result<u32>
pub fn get_kato(&self, sel: FeatureSelect) -> Result<u32>
Get Features — Keep Alive Timer (FID 0Fh).
Sourcepub fn get_hctm(&self, sel: FeatureSelect) -> Result<u32>
pub fn get_hctm(&self, sel: FeatureSelect) -> Result<u32>
Get Features — Host Controlled Thermal Management (FID 10h).
Sourcepub fn get_nopsc(&self, sel: FeatureSelect) -> Result<u32>
pub fn get_nopsc(&self, sel: FeatureSelect) -> Result<u32>
Get Features — Non-Operational Power State Config (FID 11h).
Sourcepub fn get_rrl(&self, sel: FeatureSelect) -> Result<u32>
pub fn get_rrl(&self, sel: FeatureSelect) -> Result<u32>
Get Features — Read Recovery Level (FID 12h).
Sourcepub fn get_plm_config(
&self,
sel: FeatureSelect,
nvmsetid: u16,
data: &mut PlmConfig,
) -> Result<u32>
pub fn get_plm_config( &self, sel: FeatureSelect, nvmsetid: u16, data: &mut PlmConfig, ) -> Result<u32>
Get Features — Predictable Latency Mode Config (FID 13h).
Sourcepub fn get_plm_window(&self, sel: FeatureSelect, nvmsetid: u16) -> Result<u32>
pub fn get_plm_window(&self, sel: FeatureSelect, nvmsetid: u16) -> Result<u32>
Get Features — Predictable Latency Mode Window (FID 14h).
Sourcepub fn get_lba_sts_interval(&self, sel: FeatureSelect) -> Result<u32>
pub fn get_lba_sts_interval(&self, sel: FeatureSelect) -> Result<u32>
Get Features — LBA Status Information Report Interval (FID 15h).
Sourcepub fn get_host_behavior(
&self,
sel: FeatureSelect,
data: &mut HostBehavior,
) -> Result<u32>
pub fn get_host_behavior( &self, sel: FeatureSelect, data: &mut HostBehavior, ) -> Result<u32>
Get Features — Host Behavior Support (FID 16h).
Sourcepub fn get_sanitize(&self, sel: FeatureSelect) -> Result<u32>
pub fn get_sanitize(&self, sel: FeatureSelect) -> Result<u32>
Get Features — Sanitize Config (FID 17h).
Sourcepub fn get_endurance_event_cfg(
&self,
sel: FeatureSelect,
endgid: u16,
) -> Result<u32>
pub fn get_endurance_event_cfg( &self, sel: FeatureSelect, endgid: u16, ) -> Result<u32>
Get Features — Endurance Group Event Configuration (FID 18h).
Sourcepub fn get_sw_progress(&self, sel: FeatureSelect) -> Result<u32>
pub fn get_sw_progress(&self, sel: FeatureSelect) -> Result<u32>
Get Features — Software Progress Marker (FID 80h).
Sourcepub fn get_host_id(
&self,
sel: FeatureSelect,
exhid: bool,
hostid: &mut [u8],
) -> Result<()>
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.
Sourcepub fn get_resv_mask(&self, sel: FeatureSelect) -> Result<u32>
pub fn get_resv_mask(&self, sel: FeatureSelect) -> Result<u32>
Get Features — Reservation Notification Mask (FID 82h).
Sourcepub fn get_resv_mask2(&self, sel: FeatureSelect, nsid: u32) -> Result<u32>
pub fn get_resv_mask2(&self, sel: FeatureSelect, nsid: u32) -> Result<u32>
Get Features — Reservation Notification Mask (FID 82h), NSID-scoped extended form.
Sourcepub fn get_resv_persist(&self, sel: FeatureSelect) -> Result<u32>
pub fn get_resv_persist(&self, sel: FeatureSelect) -> Result<u32>
Get Features — Reservation Persistence (FID 83h).
Sourcepub fn get_resv_persist2(&self, sel: FeatureSelect, nsid: u32) -> Result<u32>
pub fn get_resv_persist2(&self, sel: FeatureSelect, nsid: u32) -> Result<u32>
Get Features — Reservation Persistence (FID 83h), NSID-scoped extended form.
Sourcepub fn get_write_protect(&self, sel: FeatureSelect, nsid: u32) -> Result<u32>
pub fn get_write_protect(&self, sel: FeatureSelect, nsid: u32) -> Result<u32>
Get Features — Namespace Write Protection (FID 84h).
Sourcepub fn get_iocs_profile(&self, sel: FeatureSelect) -> Result<u32>
pub fn get_iocs_profile(&self, sel: FeatureSelect) -> Result<u32>
Get Features — IO Command Set Profile (FID 19h, NVMe 2.0).
Source§impl Features<'_, '_>
impl Features<'_, '_>
Sourcepub fn set_arbitration(
&self,
ab: u8,
lpw: u8,
mpw: u8,
hpw: u8,
save: bool,
) -> Result<u32>
pub fn set_arbitration( &self, ab: u8, lpw: u8, mpw: u8, hpw: u8, save: bool, ) -> Result<u32>
Set Features — Arbitration (FID 01h).
Sourcepub fn set_power_mgmt(&self, ps: u8, wh: u8, save: bool) -> Result<u32>
pub fn set_power_mgmt(&self, ps: u8, wh: u8, save: bool) -> Result<u32>
Set Features — Power Management (FID 02h).
Sourcepub fn set_lba_range(
&self,
nsid: u32,
nr_ranges: u8,
save: bool,
data: &mut LbaRangeType,
) -> Result<u32>
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).
Sourcepub fn set_temp_thresh(
&self,
tmpth: u16,
tmpsel: u8,
thsel: u32,
save: bool,
) -> Result<u32>
pub fn set_temp_thresh( &self, tmpth: u16, tmpsel: u8, thsel: u32, save: bool, ) -> Result<u32>
Set Features — Temperature Threshold (FID 04h).
Sourcepub fn set_temp_thresh2(
&self,
tmpth: u16,
tmpsel: u8,
thsel: u32,
tmpthh: u8,
save: bool,
) -> Result<u32>
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.
Sourcepub fn set_err_recovery(
&self,
nsid: u32,
tler: u16,
dulbe: bool,
save: bool,
) -> Result<u32>
pub fn set_err_recovery( &self, nsid: u32, tler: u16, dulbe: bool, save: bool, ) -> Result<u32>
Set Features — Error Recovery (FID 05h).
Sourcepub fn set_volatile_wc(&self, wce: bool, save: bool) -> Result<u32>
pub fn set_volatile_wc(&self, wce: bool, save: bool) -> Result<u32>
Set Features — Volatile Write Cache (FID 06h).
Sourcepub fn set_irq_coalesce(&self, thr: u8, time: u8, save: bool) -> Result<u32>
pub fn set_irq_coalesce(&self, thr: u8, time: u8, save: bool) -> Result<u32>
Set Features — Interrupt Coalescing (FID 08h).
Sourcepub fn set_irq_config(&self, iv: u16, cd: bool, save: bool) -> Result<u32>
pub fn set_irq_config(&self, iv: u16, cd: bool, save: bool) -> Result<u32>
Set Features — Interrupt Vector Configuration (FID 09h).
Sourcepub fn set_write_atomic(&self, dn: bool, save: bool) -> Result<u32>
pub fn set_write_atomic(&self, dn: bool, save: bool) -> Result<u32>
Set Features — Write Atomicity Normal (FID 0Ah).
Sourcepub fn set_async_event(&self, events: u32, save: bool) -> Result<u32>
pub fn set_async_event(&self, events: u32, save: bool) -> Result<u32>
Set Features — Async Event Configuration (FID 0Bh).
Sourcepub fn set_auto_pst(
&self,
apste: bool,
save: bool,
apst: &mut AutoPst,
) -> Result<u32>
pub fn set_auto_pst( &self, apste: bool, save: bool, apst: &mut AutoPst, ) -> Result<u32>
Set Features — Auto Power State Transition (FID 0Ch).
Sourcepub fn set_timestamp(&self, save: bool, timestamp: u64) -> Result<()>
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.)
Sourcepub fn set_hctm(&self, tmt2: u16, tmt1: u16, save: bool) -> Result<u32>
pub fn set_hctm(&self, tmt2: u16, tmt1: u16, save: bool) -> Result<u32>
Set Features — Host Controlled Thermal Management (FID 10h).
Sourcepub fn set_nopsc(&self, noppme: bool, save: bool) -> Result<u32>
pub fn set_nopsc(&self, noppme: bool, save: bool) -> Result<u32>
Set Features — Non-Operational Power State Config (FID 11h).
Sourcepub fn set_rrl(&self, rrl: u8, nvmsetid: u16, save: bool) -> Result<u32>
pub fn set_rrl(&self, rrl: u8, nvmsetid: u16, save: bool) -> Result<u32>
Set Features — Read Recovery Level (FID 12h).
Sourcepub fn set_plm_config(
&self,
enable: bool,
nvmsetid: u16,
save: bool,
data: &mut PlmConfig,
) -> Result<u32>
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).
Sourcepub fn set_plm_window(&self, sel: u32, nvmsetid: u16, save: bool) -> Result<u32>
pub fn set_plm_window(&self, sel: u32, nvmsetid: u16, save: bool) -> Result<u32>
Set Features — Predictable Latency Mode Window (FID 14h).
Sourcepub fn set_lba_sts_interval(
&self,
lsiri: u16,
lsipi: u16,
save: bool,
) -> Result<u32>
pub fn set_lba_sts_interval( &self, lsiri: u16, lsipi: u16, save: bool, ) -> Result<u32>
Set Features — LBA Status Information Report Interval (FID 15h).
Sourcepub fn set_host_behavior(
&self,
save: bool,
data: &mut HostBehavior,
) -> Result<()>
pub fn set_host_behavior( &self, save: bool, data: &mut HostBehavior, ) -> Result<()>
Set Features — Host Behavior Support (FID 16h).
Sourcepub fn set_sanitize(&self, nodrm: bool, save: bool) -> Result<u32>
pub fn set_sanitize(&self, nodrm: bool, save: bool) -> Result<u32>
Set Features — Sanitize Config (FID 17h).
Sourcepub fn set_endurance_evt_cfg(
&self,
endgid: u16,
egwarn: u8,
save: bool,
) -> Result<u32>
pub fn set_endurance_evt_cfg( &self, endgid: u16, egwarn: u8, save: bool, ) -> Result<u32>
Set Features — Endurance Group Event Configuration (FID 18h).
Sourcepub fn set_sw_progress(&self, pbslc: u8, save: bool) -> Result<u32>
pub fn set_sw_progress(&self, pbslc: u8, save: bool) -> Result<u32>
Set Features — Software Progress Marker (FID 80h).
Sourcepub fn set_host_id(
&self,
exhid: bool,
save: bool,
hostid: &mut [u8],
) -> Result<()>
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.
Sourcepub fn set_resv_mask(&self, mask: u32, save: bool) -> Result<u32>
pub fn set_resv_mask(&self, mask: u32, save: bool) -> Result<u32>
Set Features — Reservation Notification Mask (FID 82h).
Sourcepub fn set_resv_mask2(&self, nsid: u32, mask: u32, save: bool) -> Result<u32>
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.
Sourcepub fn set_resv_persist(&self, ptpl: bool, save: bool) -> Result<u32>
pub fn set_resv_persist(&self, ptpl: bool, save: bool) -> Result<u32>
Set Features — Reservation Persistence (FID 83h).
Sourcepub fn set_resv_persist2(
&self,
nsid: u32,
ptpl: bool,
save: bool,
) -> Result<u32>
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.
Sourcepub fn set_write_protect(&self, state: u32, save: bool) -> Result<u32>
pub fn set_write_protect(&self, state: u32, save: bool) -> Result<u32>
Set Features — Namespace Write Protection (FID 84h).