#[repr(transparent)]pub struct FileBlockNumber(pub usize);Expand description
Represents a file block number within a file.
This number refers to the position of a block within a specific file. Each block contains 4096 bytes of contents. It helps in translating file-relative offsets to actual storage locations.
Tuple Fields§
§0: usizeImplementations§
Source§impl FileBlockNumber
impl FileBlockNumber
Sourcepub const fn from_offset(offset: usize) -> Self
pub const fn from_offset(offset: usize) -> Self
Computes the file block number from a byte offset within a file.
In KeOS, each file is divided into file blocks of 0x1000 bytes (4
KiB). This function calculates the file block index corresponding to a
given byte offset.
§Parameters
offset: The byte offset within the file.
§Returns
- The
FileBlockNumberthat corresponds to the given offset.
Trait Implementations§
Source§impl Add<usize> for FileBlockNumber
impl Add<usize> for FileBlockNumber
Source§impl Clone for FileBlockNumber
impl Clone for FileBlockNumber
Source§fn clone(&self) -> FileBlockNumber
fn clone(&self) -> FileBlockNumber
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FileBlockNumber
impl Debug for FileBlockNumber
Source§impl Ord for FileBlockNumber
impl Ord for FileBlockNumber
Source§impl PartialEq for FileBlockNumber
impl PartialEq for FileBlockNumber
Source§impl PartialOrd for FileBlockNumber
impl PartialOrd for FileBlockNumber
Source§fn partial_cmp(&self, other: &FileBlockNumber) -> Option<Ordering>
fn partial_cmp(&self, other: &FileBlockNumber) -> Option<Ordering>
Source§impl Step for FileBlockNumber
impl Step for FileBlockNumber
Source§fn steps_between(start: &Self, end: &Self) -> (usize, Option<usize>)
fn steps_between(start: &Self, end: &Self) -> (usize, Option<usize>)
🔬This is a nightly-only experimental API. (
step_trait)Returns the bounds on the number of successor steps required to get from
start to end
like [Iterator::size_hint()][Iterator::size_hint()]. Read moreSource§fn forward_checked(start: Self, count: usize) -> Option<Self>
fn forward_checked(start: Self, count: usize) -> Option<Self>
🔬This is a nightly-only experimental API. (
step_trait)Source§fn backward_checked(start: Self, count: usize) -> Option<Self>
fn backward_checked(start: Self, count: usize) -> Option<Self>
🔬This is a nightly-only experimental API. (
step_trait)§fn forward(start: Self, count: usize) -> Self
fn forward(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait)§unsafe fn forward_unchecked(start: Self, count: usize) -> Self
unsafe fn forward_unchecked(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait)§fn backward(start: Self, count: usize) -> Self
fn backward(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait)§unsafe fn backward_unchecked(start: Self, count: usize) -> Self
unsafe fn backward_unchecked(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait)impl Copy for FileBlockNumber
impl Eq for FileBlockNumber
impl StructuralPartialEq for FileBlockNumber
Auto Trait Implementations§
impl Freeze for FileBlockNumber
impl RefUnwindSafe for FileBlockNumber
impl Send for FileBlockNumber
impl Sync for FileBlockNumber
impl Unpin for FileBlockNumber
impl UnwindSafe for FileBlockNumber
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, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)