#[repr(C)]pub struct Header {
pub next_id: u32,
pub blob_head: u32,
}Expand description
Header for the ID allocator region.
Fields§
§next_id: u32§blob_head: u32Implementations§
Source§impl Header
impl Header
pub const SIZE: usize
pub fn from_u64(val: u64) -> Self
pub fn to_u64(self) -> u64
Sourcepub fn index_end(self) -> Option<u32>
pub fn index_end(self) -> Option<u32>
Returns the byte offset just past the last bookkeeping index, or None if the computation
would overflow a u32.
Sourcepub fn is_valid(self, length: usize) -> bool
pub fn is_valid(self, length: usize) -> bool
Returns true if the header reflects a valid state for a buffer of length bytes.
Sourcepub fn remaining_bytes(self, length: usize) -> Option<usize>
pub fn remaining_bytes(self, length: usize) -> Option<usize>
Returns the remaining number of available bytes in the region, given the length of the
region, or None in the event of an invalid header.
Trait Implementations§
impl Copy for Header
impl Eq for Header
impl StructuralPartialEq for Header
Auto Trait Implementations§
impl Freeze for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnsafeUnpin for Header
impl UnwindSafe for Header
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)