Struct sysfs_class::Block
source · pub struct Block { /* private fields */ }
Expand description
A block device in /sys/class/block
Implementations
sourceimpl Block
impl Block
pub fn has_device(&self) -> bool
pub fn children(&self) -> Result<Vec<Self>>
pub fn parent_device(&self) -> Option<Block>
sourcepub fn slaves(
&self
) -> Option<Result<Box<dyn Iterator<Item = Result<PathBuf>>>>>
pub fn slaves(
&self
) -> Option<Result<Box<dyn Iterator<Item = Result<PathBuf>>>>>
Logical devices have their parent device(s) listed here.
For example:
- dm-4 has a slave of dm-0
- dm-0 has a slave of sda3
- sda3 does not have any slaves
pub fn alignment_offset(&self) -> Result<u64>
pub fn capability(&self) -> Result<u8>
pub fn dev(&self) -> Result<String>
pub fn discard_alignment(&self) -> Result<u64>
pub fn events(&self) -> Result<u64>
pub fn events_async(&self) -> Result<u64>
pub fn events_poll_msecs(&self) -> Result<u64>
pub fn ext_range(&self) -> Result<u64>
pub fn inflight(&self) -> Result<String>
pub fn partition(&self) -> Result<u8>
pub fn range(&self) -> Result<u64>
pub fn removable(&self) -> Result<u8>
pub fn ro(&self) -> Result<u8>
pub fn size(&self) -> Result<u64>
pub fn start(&self) -> Result<u64>
pub fn stat(&self) -> Result<u8>
pub fn subsystem(&self) -> Result<u8>
pub fn uevent(&self) -> Result<String>
pub fn device_blocked(&self) -> Result<u8>
pub fn device_busy(&self) -> Result<u8>
pub fn device_model(&self) -> Result<String>
pub fn device_rev(&self) -> Result<String>
pub fn device_state(&self) -> Result<String>
pub fn device_vendor(&self) -> Result<String>
pub fn queue_add_random(&self) -> Result<u64>
pub fn queue_chunk_sectors(&self) -> Result<u64>
pub fn queue_dax(&self) -> Result<u64>
pub fn queue_discard_granularity(&self) -> Result<u64>
pub fn queue_discard_max_bytes(&self) -> Result<u64>
pub fn queue_discard_max_hw_bytes(&self) -> Result<u64>
pub fn queue_discard_zeroes_data(&self) -> Result<u64>
pub fn queue_fua(&self) -> Result<u64>
pub fn queue_hw_sector_size(&self) -> Result<u64>
pub fn queue_io_poll(&self) -> Result<u64>
pub fn queue_io_poll_delay(&self) -> Result<u64>
pub fn queue_iostats(&self) -> Result<u64>
pub fn queue_logical_block_size(&self) -> Result<u64>
pub fn queue_max_discard_segments(&self) -> Result<u64>
pub fn queue_max_hw_sectors_kb(&self) -> Result<u64>
pub fn queue_max_integrity_segments(&self) -> Result<u64>
pub fn queue_max_sectors_kb(&self) -> Result<u64>
pub fn queue_max_segment_size(&self) -> Result<u64>
pub fn queue_max_segments(&self) -> Result<u64>
pub fn queue_minimum_io_size(&self) -> Result<u64>
pub fn queue_nomerges(&self) -> Result<u64>
pub fn queue_nr_requests(&self) -> Result<u64>
pub fn queue_optimal_io_size(&self) -> Result<u64>
pub fn queue_physical_block_size(&self) -> Result<u64>
pub fn queue_read_ahead_kb(&self) -> Result<u64>
pub fn queue_rotational(&self) -> Result<u8>
pub fn queue_rq_affinity(&self) -> Result<u64>
pub fn queue_scheduler(&self) -> Result<BlockScheduler>
pub fn queue_write_cache(&self) -> Result<String>
pub fn queue_write_same_max_bytes(&self) -> Result<u64>
pub fn queue_write_zeroes_max_bytes(&self) -> Result<u64>
pub fn queue_zoned(&self) -> Result<String>
pub fn queue_iosched_back_seek_max(&self) -> Result<u64>
pub fn queue_iosched_back_seek_penalty(&self) -> Result<u64>
pub fn queue_iosched_fifo_expire_async(&self) -> Result<u64>
pub fn queue_iosched_fifo_expire_sync(&self) -> Result<u64>
pub fn queue_iosched_group_idle(&self) -> Result<u64>
pub fn queue_iosched_group_idle_us(&self) -> Result<u64>
pub fn queue_iosched_low_latency(&self) -> Result<u8>
pub fn queue_iosched_quantum(&self) -> Result<u64>
pub fn queue_iosched_slice_async(&self) -> Result<u64>
pub fn queue_iosched_slice_async_rq(&self) -> Result<u64>
pub fn queue_iosched_slice_async_us(&self) -> Result<u64>
pub fn queue_iosched_slice_idle(&self) -> Result<u8>
pub fn queue_iosched_slice_idle_us(&self) -> Result<u64>
pub fn queue_iosched_slice_sync(&self) -> Result<u64>
pub fn queue_iosched_slice_sync_us(&self) -> Result<u64>
pub fn queue_iosched_target_latency(&self) -> Result<u64>
pub fn queue_iosched_target_latency_us(&self) -> Result<u64>
Trait Implementations
sourceimpl Ord for Block
impl Ord for Block
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<Block> for Block
impl PartialOrd<Block> for Block
sourcefn partial_cmp(&self, other: &Block) -> Option<Ordering>
fn partial_cmp(&self, other: &Block) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl SysClass for Block
impl SysClass for Block
sourcefn class() -> &'static str
fn class() -> &'static str
Return the class of the sys object, the name of a folder in /sys/class
sourceunsafe fn from_path_unchecked(path: PathBuf) -> Self
unsafe fn from_path_unchecked(path: PathBuf) -> Self
Create a sys object from an absolute path without checking path for validity
sourcefn dir() -> PathBuf
fn dir() -> PathBuf
Return the path to the sys objects, the full path of a folder in /sys/class
sourcefn from_path(path: &Path) -> Result<Self>
fn from_path(path: &Path) -> Result<Self>
Create a sys object from a path, checking it for validity
sourcefn read_file<P: AsRef<Path>>(&self, name: P) -> Result<String>
fn read_file<P: AsRef<Path>>(&self, name: P) -> Result<String>
Read a file underneath the sys object
sourcefn parse_file<F: FromStr, P: AsRef<Path>>(&self, name: P) -> Result<F>where
F::Err: Display,
fn parse_file<F: FromStr, P: AsRef<Path>>(&self, name: P) -> Result<F>where
F::Err: Display,
Parse a number from a file underneath the sys object
impl Eq for Block
impl StructuralEq for Block
impl StructuralPartialEq for Block
Auto Trait Implementations
impl RefUnwindSafe for Block
impl Send for Block
impl Sync for Block
impl Unpin for Block
impl UnwindSafe for Block
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more