Skip to main content

Part

Struct Part 

Source
pub struct Part { /* private fields */ }
Expand description

One named part of the arena. Offsets are within the part, and an access past it ends the driver naming the part. Copies are views of the same bytes.

Implementations§

Source§

impl Part

Source

pub fn name(&self) -> &'static str

The name it was taken with.

Source

pub fn len(&self) -> usize

Its size in bytes.

Source

pub fn offset(&self) -> usize

Where it starts in the arena, for a log line.

Source

pub fn phys(&self) -> u64

The physical address of its first byte.

Source

pub fn phys_at(&self, off: usize) -> u64

The physical address of byte off within it: what the device is given.

Source

pub fn zero(&self)

Zero the part, with aligned volatile stores where it is aligned and bytes where it is not.

Source

pub fn read8(&self, off: usize) -> u8

Read 8 bits at off within the part.

Source

pub fn read16(&self, off: usize) -> u16

Read 16 bits at off within the part.

Source

pub fn read32(&self, off: usize) -> u32

Read 32 bits at off within the part.

Source

pub fn read64(&self, off: usize) -> u64

Read 64 bits at off within the part.

Source

pub fn write8(&self, off: usize, val: u8)

Write 8 bits at off within the part.

Source

pub fn write16(&self, off: usize, val: u16)

Write 16 bits at off within the part.

Source

pub fn write32(&self, off: usize, val: u32)

Write 32 bits at off within the part.

Source

pub fn write64(&self, off: usize, val: u64)

Write 64 bits at off within the part.

Trait Implementations§

Source§

impl Clone for Part

Source§

fn clone(&self) -> Part

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Part

Auto Trait Implementations§

§

impl Freeze for Part

§

impl RefUnwindSafe for Part

§

impl !Send for Part

§

impl !Sync for Part

§

impl Unpin for Part

§

impl UnsafeUnpin for Part

§

impl UnwindSafe for Part

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.