Skip to main content

DeviceItem

Struct DeviceItem 

Source
pub struct DeviceItem {
Show 14 fields pub devid: u64, pub total_bytes: u64, pub bytes_used: u64, pub io_align: u32, pub io_width: u32, pub sector_size: u32, pub dev_type: u64, pub generation: u64, pub start_offset: u64, pub dev_group: u32, pub seek_speed: u8, pub bandwidth: u8, pub uuid: Uuid, pub fsid: Uuid,
}
Expand description

Device item describing a single device in the filesystem.

Stored in the device tree and embedded in the superblock. Contains the device’s size, usage, and identifying UUIDs.

Fields§

§devid: u64

Unique device ID within this filesystem.

§total_bytes: u64

Total size of the device in bytes.

§bytes_used: u64

Bytes allocated on this device.

§io_align: u32

I/O alignment requirement.

§io_width: u32

I/O width requirement.

§sector_size: u32

Sector size of this device.

§dev_type: u64

Device type (reserved, always 0).

§generation: u64

Generation when this device was last updated.

§start_offset: u64

Start offset for allocations on this device.

§dev_group: u32

Device group (reserved, always 0).

§seek_speed: u8

Seek speed hint (0 = not set).

§bandwidth: u8

Bandwidth hint (0 = not set).

§uuid: Uuid

UUID of this device.

§fsid: Uuid

Filesystem UUID that this device belongs to.

Implementations§

Source§

impl DeviceItem

Source

pub fn write_bytes(&self, buf: &mut impl BufMut)

Serialize this device item to a BufMut in on-disk little-endian format.

Source

pub fn parse(data: &[u8]) -> Option<Self>

Parse a device item from a raw byte buffer.

Trait Implementations§

Source§

impl Clone for DeviceItem

Source§

fn clone(&self) -> DeviceItem

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DeviceItem

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.