Struct IOAddr

Source
#[repr(transparent)]
pub struct IOAddr(pub u32);
Expand description

A wrapper for an IO address (IOVA / DMA Address for devices)

Tuple Fields§

§0: u32

Implementations§

Source§

impl IOAddr

Source

pub fn as_u32(self) -> u32

Convert to u32

Source

pub fn as_usize(self) -> usize

Convert to usize

Source

pub const fn zero() -> Self

IO Address zero.

Source

pub fn is_zero(self) -> bool

Is zero?

Source

pub fn base_page_offset(self) -> u32

Offset within the 4 KiB page.

Source

pub fn large_page_offset(self) -> u32

Offset within the 4 MiB page.

Source

pub fn align_down_to_base_page(self) -> Self

Return address of nearest 4 KiB page (lower or equal than self).

Source

pub fn align_down_to_large_page(self) -> Self

Return address of nearest 4 MiB page (lower or equal than self).

Source

pub fn align_up_to_base_page(self) -> Self

Return address of nearest 4 KiB page (higher or equal than self).

Source

pub fn align_up_to_large_page(self) -> Self

Return address of nearest 4 MiB page (higher or equal than self).

Source

pub fn is_base_page_aligned(self) -> bool

Is this address aligned to a 4 KiB page?

Source

pub fn is_large_page_aligned(self) -> bool

Is this address aligned to a 4 MiB page?

Source

pub fn is_aligned<U>(self, align: U) -> bool
where U: Into<u32> + Copy,

Is this address aligned to align?

§Note

align must be a power of two.

Trait Implementations§

Source§

impl Add<u32> for IOAddr

Source§

type Output = IOAddr

The resulting type after applying the + operator.
Source§

fn add(self, rhs: u32) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<usize> for IOAddr

Source§

type Output = IOAddr

The resulting type after applying the + operator.
Source§

fn add(self, rhs: usize) -> Self::Output

Performs the + operation. Read more
Source§

impl Add for IOAddr

Source§

type Output = IOAddr

The resulting type after applying the + operator.
Source§

fn add(self, rhs: IOAddr) -> Self::Output

Performs the + operation. Read more
Source§

impl AddAssign<u32> for IOAddr

Source§

fn add_assign(&mut self, offset: u32)

Performs the += operation. Read more
Source§

impl AddAssign for IOAddr

Source§

fn add_assign(&mut self, other: IOAddr)

Performs the += operation. Read more
Source§

impl Binary for IOAddr

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl BitAnd<u32> for IOAddr

Source§

type Output = u32

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: u32) -> Self::Output

Performs the & operation. Read more
Source§

impl BitAnd for IOAddr

Source§

type Output = IOAddr

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Self) -> Self

Performs the & operation. Read more
Source§

impl BitOr<u32> for IOAddr

Source§

type Output = u32

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: u32) -> Self::Output

Performs the | operation. Read more
Source§

impl BitOr for IOAddr

Source§

type Output = IOAddr

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: IOAddr) -> Self::Output

Performs the | operation. Read more
Source§

impl Clone for IOAddr

Source§

fn clone(&self) -> IOAddr

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for IOAddr

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for IOAddr

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<i32> for IOAddr

Source§

fn from(num: i32) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for IOAddr

Source§

fn from(num: u32) -> Self

Converts to this type from the input type.
Source§

impl From<usize> for IOAddr

Source§

fn from(num: usize) -> Self

Converts to this type from the input type.
Source§

impl Hash for IOAddr

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Into<u32> for IOAddr

Source§

fn into(self) -> u32

Converts this type into the (usually inferred) input type.
Source§

impl Into<usize> for IOAddr

Source§

fn into(self) -> usize

Converts this type into the (usually inferred) input type.
Source§

impl LowerHex for IOAddr

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Octal for IOAddr

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Ord for IOAddr

Source§

fn cmp(&self, other: &IOAddr) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for IOAddr

Source§

fn eq(&self, other: &IOAddr) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for IOAddr

Source§

fn partial_cmp(&self, other: &IOAddr) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Pointer for IOAddr

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Rem<u32> for IOAddr

Source§

type Output = u32

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: u32) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<usize> for IOAddr

Source§

type Output = u32

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: usize) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem for IOAddr

Source§

type Output = IOAddr

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: IOAddr) -> Self::Output

Performs the % operation. Read more
Source§

impl Shr<u32> for IOAddr

Source§

type Output = u32

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u32) -> Self::Output

Performs the >> operation. Read more
Source§

impl Sub<u32> for IOAddr

Source§

type Output = IOAddr

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: u32) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<usize> for IOAddr

Source§

type Output = IOAddr

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: usize) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub for IOAddr

Source§

type Output = IOAddr

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: IOAddr) -> Self::Output

Performs the - operation. Read more
Source§

impl UpperHex for IOAddr

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for IOAddr

Source§

impl Eq for IOAddr

Source§

impl StructuralPartialEq for IOAddr

Auto Trait Implementations§

§

impl Freeze for IOAddr

§

impl RefUnwindSafe for IOAddr

§

impl Send for IOAddr

§

impl Sync for IOAddr

§

impl Unpin for IOAddr

§

impl UnwindSafe for IOAddr

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.