[][src]Struct mbrman::MBRPartitionEntry

pub struct MBRPartitionEntry {
    pub boot: bool,
    pub first_chs: CHS,
    pub sys: u8,
    pub last_chs: CHS,
    pub starting_lba: u32,
    pub sectors: u32,
}

An MBR partition entry

Fields

boot: bool

Boot flag

first_chs: CHS

CHS address of the first sector in the partition

sys: u8

Partition type (file system ID)

last_chs: CHS

CHS address of the last sector in the partition

starting_lba: u32

Starting LBA of the partition

sectors: u32

Number of sectors allocated to the partition

Implementations

impl MBRPartitionEntry[src]

pub fn empty() -> MBRPartitionEntry[src]

Creates an empty partition entry

Examples

Basic usage:

let ss = 512;
let data = vec![0; 100 * ss as usize];
let mut cur = std::io::Cursor::new(data);
let mut mbr = mbrman::MBR::new_from(&mut cur, ss as u32, [0xff; 4])
    .expect("could not create partition table");

mbr[1] = mbrman::MBRPartitionEntry::empty();

// NOTE: an empty partition entry is considered as not allocated
assert!(mbr[1].is_unused());

pub fn is_used(&self) -> bool[src]

Returns true if the partition entry is used (type (sys) != 0)

pub fn is_unused(&self) -> bool[src]

Returns true if the partition entry is not used (type (sys) == 0)

pub fn is_extended(&self) -> bool[src]

Returns true if the partition is an extended type partition

Trait Implementations

impl Clone for MBRPartitionEntry[src]

impl Debug for MBRPartitionEntry[src]

impl<'de> Deserialize<'de> for MBRPartitionEntry[src]

impl PartialEq<MBRPartitionEntry> for MBRPartitionEntry[src]

impl Serialize for MBRPartitionEntry[src]

impl StructuralPartialEq for MBRPartitionEntry[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.