[−][src]Struct mbrman::CHS
A CHS address (cylinder/head/sector)
Fields
cylinder: u16
Cylinder
head: u8
Head
sector: u8
Sector
Methods
impl CHS
[src]
pub fn new(cylinder: u16, head: u8, sector: u8) -> CHS
[src]
Creates a new CHS address based on input parameters.
Remark
The values entered in input are not checked.
pub fn empty() -> CHS
[src]
Creates an empty CHS addressing (0/0/0).
Remark
This is what you need on recent hardware because CHS is never used.
pub fn from_lba_exact(
lba: u32,
cylinders: u16,
heads: u8,
sectors: u8
) -> Result<CHS>
[src]
lba: u32,
cylinders: u16,
heads: u8,
sectors: u8
) -> Result<CHS>
Creates a CHS address calculated from the number of cylinders, heads and sectors per track of the hard disk.
Remarks
- You probably don't need to do this at all! This is only useful if you intend to use partitions that use the CHS addressing. Check the column "Access" of this table on Wikipedia.
- On old systems, partitions must be aligned on cylinders.
pub fn from_lba_aligned(
lba: u32,
cylinders: u16,
heads: u8,
sectors: u8
) -> Result<CHS>
[src]
lba: u32,
cylinders: u16,
heads: u8,
sectors: u8
) -> Result<CHS>
Creates a CHS address, aligned to the nearest cylinder. The cylinder chosen will always be the exact cylinder (if the LBA is exactly at the beginning of a cylinder); or the next cylinder. But it will never choose the previous cylinder.
pub fn to_lba(self, heads: u8, sectors: u8) -> u32
[src]
Convert a CHS address to LBA
pub fn is_empty(self) -> bool
[src]
Check if the CHS address is empty
Remark
This function does not check if the CHS address is withing range of possible values for a provided hard disk.
pub fn is_valid(self, cylinders: u16, heads: u8, sectors: u8) -> bool
[src]
Check if the CHS address is valid and within range of the possible values for the hard disk geometry provided in argument.
Trait Implementations
impl Clone for CHS
[src]
impl Copy for CHS
[src]
impl Debug for CHS
[src]
impl<'de> Deserialize<'de> for CHS
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl PartialEq<CHS> for CHS
[src]
impl Serialize for CHS
[src]
impl StructuralPartialEq for CHS
[src]
Auto Trait Implementations
impl RefUnwindSafe for CHS
impl Send for CHS
impl Sync for CHS
impl Unpin for CHS
impl UnwindSafe for CHS
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,