pub struct BlockIdx(pub u32);
Expand description
Represents the linear numeric address of a block (or sector). The first
block on a disk gets BlockIdx(0)
(which usually contains the Master Boot
Record).
Tuple Fields§
§0: u32
Implementations§
Source§impl BlockIdx
impl BlockIdx
Sourcepub fn into_bytes(self) -> u64
pub fn into_bytes(self) -> u64
Convert a block index into a 64-bit byte offset from the start of the
volume. Useful if your underlying block device actually works in
bytes, like open("/dev/mmcblk0")
does on Linux.
Sourcepub fn range(self, num: BlockCount) -> BlockIter ⓘ
pub fn range(self, num: BlockCount) -> BlockIter ⓘ
Create an iterator from the current BlockIdx
through the given
number of blocks.
Trait Implementations§
Source§impl Add<BlockCount> for BlockIdx
impl Add<BlockCount> for BlockIdx
Source§impl AddAssign<BlockCount> for BlockIdx
impl AddAssign<BlockCount> for BlockIdx
Source§fn add_assign(&mut self, rhs: BlockCount)
fn add_assign(&mut self, rhs: BlockCount)
Performs the
+=
operation. Read moreSource§impl Ord for BlockIdx
impl Ord for BlockIdx
Source§impl PartialOrd for BlockIdx
impl PartialOrd for BlockIdx
Source§impl Sub<BlockCount> for BlockIdx
impl Sub<BlockCount> for BlockIdx
Source§impl SubAssign<BlockCount> for BlockIdx
impl SubAssign<BlockCount> for BlockIdx
Source§fn sub_assign(&mut self, rhs: BlockCount)
fn sub_assign(&mut self, rhs: BlockCount)
Performs the
-=
operation. Read moreimpl Copy for BlockIdx
impl Eq for BlockIdx
impl StructuralPartialEq for BlockIdx
Auto Trait Implementations§
impl Freeze for BlockIdx
impl RefUnwindSafe for BlockIdx
impl Send for BlockIdx
impl Sync for BlockIdx
impl Unpin for BlockIdx
impl UnwindSafe for BlockIdx
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<Q, K> Comparable<K> for Qwhere
Q: Ord + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Comparable<K> for Qwhere
Q: Ord + ?Sized,
K: Borrow<Q> + ?Sized,
Source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.