pub struct SectorSizeInfoFlags { /* private fields */ }Expand description
File system sector flags.
Implementations§
Source§impl SectorSizeInfoFlags
impl SectorSizeInfoFlags
Sourcepub const fn into_bytes(self) -> [u8; 4]
pub const fn into_bytes(self) -> [u8; 4]
Sourcepub const fn from_bytes(bytes: [u8; 4]) -> Self
pub const fn from_bytes(bytes: [u8; 4]) -> Self
Converts the given bytes directly into the bitfield struct.
Source§impl SectorSizeInfoFlags
impl SectorSizeInfoFlags
Sourcepub fn aligned_device(&self) -> <bool as Specifier>::InOut
pub fn aligned_device(&self) -> <bool as Specifier>::InOut
Returns the value of aligned_device. When set, this flag indicates that the first physical sector of the device is aligned with the first logical sector. When not set, the first physical sector of the device is misaligned with the first logical sector.
Sourcepub fn aligned_device_or_err(
&self,
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
pub fn aligned_device_or_err( &self, ) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of aligned_device.
#Errors
If the returned value contains an invalid bit pattern for aligned_device. When set, this flag indicates that the first physical sector of the device is aligned with the first logical sector. When not set, the first physical sector of the device is misaligned with the first logical sector.
Sourcepub fn with_aligned_device(self, new_val: <bool as Specifier>::InOut) -> Self
pub fn with_aligned_device(self, new_val: <bool as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of aligned_device set to the given value.
#Panics
If the given value is out of bounds for aligned_device. When set, this flag indicates that the first physical sector of the device is aligned with the first logical sector. When not set, the first physical sector of the device is misaligned with the first logical sector.
Sourcepub fn with_aligned_device_checked(
self,
new_val: <bool as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_aligned_device_checked( self, new_val: <bool as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of aligned_device set to the given value.
#Errors
If the given value is out of bounds for aligned_device. When set, this flag indicates that the first physical sector of the device is aligned with the first logical sector. When not set, the first physical sector of the device is misaligned with the first logical sector.
Sourcepub fn set_aligned_device(&mut self, new_val: <bool as Specifier>::InOut)
pub fn set_aligned_device(&mut self, new_val: <bool as Specifier>::InOut)
Sets the value of aligned_device to the given value.
#Panics
If the given value is out of bounds for aligned_device. When set, this flag indicates that the first physical sector of the device is aligned with the first logical sector. When not set, the first physical sector of the device is misaligned with the first logical sector.
Sourcepub fn set_aligned_device_checked(
&mut self,
new_val: <bool as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_aligned_device_checked( &mut self, new_val: <bool as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of aligned_device to the given value.
#Errors
If the given value is out of bounds for aligned_device. When set, this flag indicates that the first physical sector of the device is aligned with the first logical sector. When not set, the first physical sector of the device is misaligned with the first logical sector.
Sourcepub fn partition_aligned_on_device(&self) -> <bool as Specifier>::InOut
pub fn partition_aligned_on_device(&self) -> <bool as Specifier>::InOut
Returns the value of partition_aligned_on_device. When set, this flag indicates that the partition is aligned to physical sector boundaries on the storage device.
Sourcepub fn partition_aligned_on_device_or_err(
&self,
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
pub fn partition_aligned_on_device_or_err( &self, ) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of partition_aligned_on_device.
#Errors
If the returned value contains an invalid bit pattern for partition_aligned_on_device. When set, this flag indicates that the partition is aligned to physical sector boundaries on the storage device.
Sourcepub fn with_partition_aligned_on_device(
self,
new_val: <bool as Specifier>::InOut,
) -> Self
pub fn with_partition_aligned_on_device( self, new_val: <bool as Specifier>::InOut, ) -> Self
Returns a copy of the bitfield with the value of partition_aligned_on_device set to the given value.
#Panics
If the given value is out of bounds for partition_aligned_on_device. When set, this flag indicates that the partition is aligned to physical sector boundaries on the storage device.
Sourcepub fn with_partition_aligned_on_device_checked(
self,
new_val: <bool as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_partition_aligned_on_device_checked( self, new_val: <bool as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of partition_aligned_on_device set to the given value.
#Errors
If the given value is out of bounds for partition_aligned_on_device. When set, this flag indicates that the partition is aligned to physical sector boundaries on the storage device.
Sourcepub fn set_partition_aligned_on_device(
&mut self,
new_val: <bool as Specifier>::InOut,
)
pub fn set_partition_aligned_on_device( &mut self, new_val: <bool as Specifier>::InOut, )
Sets the value of partition_aligned_on_device to the given value.
#Panics
If the given value is out of bounds for partition_aligned_on_device. When set, this flag indicates that the partition is aligned to physical sector boundaries on the storage device.
Sourcepub fn set_partition_aligned_on_device_checked(
&mut self,
new_val: <bool as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_partition_aligned_on_device_checked( &mut self, new_val: <bool as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of partition_aligned_on_device to the given value.
#Errors
If the given value is out of bounds for partition_aligned_on_device. When set, this flag indicates that the partition is aligned to physical sector boundaries on the storage device.
Sourcepub fn no_seek_penalty(&self) -> <bool as Specifier>::InOut
pub fn no_seek_penalty(&self) -> <bool as Specifier>::InOut
Returns the value of no_seek_penalty. When set, the device reports that it does not incur a seek penalty (this typically indicates that the device does not have rotating media, such as flash-based disks).
Sourcepub fn no_seek_penalty_or_err(
&self,
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
pub fn no_seek_penalty_or_err( &self, ) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of no_seek_penalty.
#Errors
If the returned value contains an invalid bit pattern for no_seek_penalty. When set, the device reports that it does not incur a seek penalty (this typically indicates that the device does not have rotating media, such as flash-based disks).
Sourcepub fn with_no_seek_penalty(self, new_val: <bool as Specifier>::InOut) -> Self
pub fn with_no_seek_penalty(self, new_val: <bool as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of no_seek_penalty set to the given value.
#Panics
If the given value is out of bounds for no_seek_penalty. When set, the device reports that it does not incur a seek penalty (this typically indicates that the device does not have rotating media, such as flash-based disks).
Sourcepub fn with_no_seek_penalty_checked(
self,
new_val: <bool as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_no_seek_penalty_checked( self, new_val: <bool as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of no_seek_penalty set to the given value.
#Errors
If the given value is out of bounds for no_seek_penalty. When set, the device reports that it does not incur a seek penalty (this typically indicates that the device does not have rotating media, such as flash-based disks).
Sourcepub fn set_no_seek_penalty(&mut self, new_val: <bool as Specifier>::InOut)
pub fn set_no_seek_penalty(&mut self, new_val: <bool as Specifier>::InOut)
Sets the value of no_seek_penalty to the given value.
#Panics
If the given value is out of bounds for no_seek_penalty. When set, the device reports that it does not incur a seek penalty (this typically indicates that the device does not have rotating media, such as flash-based disks).
Sourcepub fn set_no_seek_penalty_checked(
&mut self,
new_val: <bool as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_no_seek_penalty_checked( &mut self, new_val: <bool as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of no_seek_penalty to the given value.
#Errors
If the given value is out of bounds for no_seek_penalty. When set, the device reports that it does not incur a seek penalty (this typically indicates that the device does not have rotating media, such as flash-based disks).
Sourcepub fn trim_enabled(&self) -> <bool as Specifier>::InOut
pub fn trim_enabled(&self) -> <bool as Specifier>::InOut
Returns the value of trim_enabled. When set, the device supports TRIM operations, either T13 (ATA) TRIM or T10 (SCSI/SAS) UNMAP.
Sourcepub fn trim_enabled_or_err(
&self,
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
pub fn trim_enabled_or_err( &self, ) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of trim_enabled.
#Errors
If the returned value contains an invalid bit pattern for trim_enabled. When set, the device supports TRIM operations, either T13 (ATA) TRIM or T10 (SCSI/SAS) UNMAP.
Sourcepub fn with_trim_enabled(self, new_val: <bool as Specifier>::InOut) -> Self
pub fn with_trim_enabled(self, new_val: <bool as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of trim_enabled set to the given value.
#Panics
If the given value is out of bounds for trim_enabled. When set, the device supports TRIM operations, either T13 (ATA) TRIM or T10 (SCSI/SAS) UNMAP.
Sourcepub fn with_trim_enabled_checked(
self,
new_val: <bool as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_trim_enabled_checked( self, new_val: <bool as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of trim_enabled set to the given value.
#Errors
If the given value is out of bounds for trim_enabled. When set, the device supports TRIM operations, either T13 (ATA) TRIM or T10 (SCSI/SAS) UNMAP.
Sourcepub fn set_trim_enabled(&mut self, new_val: <bool as Specifier>::InOut)
pub fn set_trim_enabled(&mut self, new_val: <bool as Specifier>::InOut)
Sets the value of trim_enabled to the given value.
#Panics
If the given value is out of bounds for trim_enabled. When set, the device supports TRIM operations, either T13 (ATA) TRIM or T10 (SCSI/SAS) UNMAP.
Sourcepub fn set_trim_enabled_checked(
&mut self,
new_val: <bool as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_trim_enabled_checked( &mut self, new_val: <bool as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of trim_enabled to the given value.
#Errors
If the given value is out of bounds for trim_enabled. When set, the device supports TRIM operations, either T13 (ATA) TRIM or T10 (SCSI/SAS) UNMAP.
Trait Implementations§
Source§impl BinRead for SectorSizeInfoFlags
impl BinRead for SectorSizeInfoFlags
Source§fn read_options<R: Read + Seek>(
__binrw_generated_var_reader: &mut R,
__binrw_generated_var_endian: Endian,
__binrw_generated_var_arguments: Self::Args<'_>,
) -> BinResult<Self>
fn read_options<R: Read + Seek>( __binrw_generated_var_reader: &mut R, __binrw_generated_var_endian: Endian, __binrw_generated_var_arguments: Self::Args<'_>, ) -> BinResult<Self>
Source§fn read<R>(reader: &mut R) -> Result<Self, Error>
fn read<R>(reader: &mut R) -> Result<Self, Error>
Self from the reader using default arguments. Read moreSource§fn read_be<R>(reader: &mut R) -> Result<Self, Error>
fn read_be<R>(reader: &mut R) -> Result<Self, Error>
Self from the reader using default arguments and assuming
big-endian byte order. Read moreSource§fn read_le<R>(reader: &mut R) -> Result<Self, Error>
fn read_le<R>(reader: &mut R) -> Result<Self, Error>
Self from the reader using default arguments and assuming
little-endian byte order. Read moreSource§fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
T from the reader assuming native-endian byte order. Read moreSource§fn read_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
fn read_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
Self from the reader using the given arguments. Read moreSource§fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
Self from the reader, assuming big-endian byte order, using the
given arguments. Read moreSource§impl BinWrite for SectorSizeInfoFlags
impl BinWrite for SectorSizeInfoFlags
Source§fn write_options<W: Write + Seek>(
&self,
__binrw_generated_var_writer: &mut W,
__binrw_generated_var_endian: Endian,
__binrw_generated_var_arguments: Self::Args<'_>,
) -> BinResult<()>
fn write_options<W: Write + Seek>( &self, __binrw_generated_var_writer: &mut W, __binrw_generated_var_endian: Endian, __binrw_generated_var_arguments: Self::Args<'_>, ) -> BinResult<()>
Source§fn write<W>(&self, writer: &mut W) -> Result<(), Error>
fn write<W>(&self, writer: &mut W) -> Result<(), Error>
Self to the writer using default arguments. Read moreSource§fn write_be<W>(&self, writer: &mut W) -> Result<(), Error>
fn write_be<W>(&self, writer: &mut W) -> Result<(), Error>
Self to the writer assuming big-endian byte order. Read moreSource§fn write_le<W>(&self, writer: &mut W) -> Result<(), Error>
fn write_le<W>(&self, writer: &mut W) -> Result<(), Error>
Self to the writer assuming little-endian byte order. Read moreSource§fn write_ne<W>(&self, writer: &mut W) -> Result<(), Error>
fn write_ne<W>(&self, writer: &mut W) -> Result<(), Error>
Self to the writer assuming native-endian byte order. Read moreSource§fn write_args<W>(
&self,
writer: &mut W,
args: Self::Args<'_>,
) -> Result<(), Error>
fn write_args<W>( &self, writer: &mut W, args: Self::Args<'_>, ) -> Result<(), Error>
Self to the writer using the given arguments. Read moreSource§fn write_be_args<W>(
&self,
writer: &mut W,
args: Self::Args<'_>,
) -> Result<(), Error>
fn write_be_args<W>( &self, writer: &mut W, args: Self::Args<'_>, ) -> Result<(), Error>
Self to the writer, assuming big-endian byte order, using the
given arguments. Read moreSource§impl Clone for SectorSizeInfoFlags
impl Clone for SectorSizeInfoFlags
Source§fn clone(&self) -> SectorSizeInfoFlags
fn clone(&self) -> SectorSizeInfoFlags
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more