Struct BaseCap

Source
pub struct BaseCap<'a> { /* private fields */ }
Expand description

A single capability within a specific device’s configuration space.

This is a generic representation of a capability. It provides only low-level methods for reading and writing the capability fields. Other structs in this module will wrap this struct and provide higher level methods for accessing specific fields.

The 'a lifetime references the Device this capability belongs to.

Implementations§

Source§

impl BaseCap<'_>

Source

pub fn id(&self) -> u8

Returns the ID of this capability.

Source

pub fn next(&self) -> u8

Returns the next capability pointer.

Source

pub fn read8(&self, offset: u16) -> u8

Reads an 8-bit value relative to the base of this capability.

Source

pub fn write8(&self, offset: u16, val: u8)

Writes an 8-bit value relative to the base of this capability.

Source

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

Reads a 16-bit value relative to the base of this capability.

Source

pub fn write16(&self, offset: u16, val: u16)

Writes a 16-bit value relative to the base of this capability.

Source

pub fn read32(&self, offset: u16) -> u32

Reads a 32-bit value relative to the base of this capability.

Source

pub fn write32(&self, offset: u16, val: u32)

Writes a 32-bit value relative to the base of this capability.

Trait Implementations§

Source§

impl<'a> Clone for BaseCap<'a>

Source§

fn clone(&self) -> BaseCap<'a>

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<'a> Debug for BaseCap<'a>

Source§

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

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

impl<'a> From<BaseCap<'a>> for Cap<'a>

Source§

fn from(base: BaseCap<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> Copy for BaseCap<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for BaseCap<'a>

§

impl<'a> RefUnwindSafe for BaseCap<'a>

§

impl<'a> Send for BaseCap<'a>

§

impl<'a> Sync for BaseCap<'a>

§

impl<'a> Unpin for BaseCap<'a>

§

impl<'a> UnwindSafe for BaseCap<'a>

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.