Struct Device

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

A handle for a device.

Implementations§

Source§

impl Device

Source

pub fn pcie_capabilities<'a>( &'a self, mm: &'a MmioObject, ) -> Option<PcieCapabilityIterator<'a>>

Source

pub fn find_mmio_bar(&self, bar: usize) -> Option<MmioObject>

Source

pub fn allocate_interrupt(&self, inum: usize) -> Result<(InterruptVector, u32)>

Source§

impl Device

Source

pub fn children(&self) -> DeviceChildrenIterator

Get an iterator over the children of this device.

Source§

impl Device

Source

pub unsafe fn get_info<T>(&self, idx: u8) -> Option<InfoObject<T>>

Get an indexed info object for a device.

§Safety

The type T is not verified in any way, so the caller must ensure that T is correct for the underlying data.

Source§

impl Device

Source

pub fn get_mmio(&self, idx: u8) -> Option<MmioObject>

Get a handle to a MMIO type subobject.

Source§

impl Device

Source

pub fn new(id: ObjID) -> Result<Self>

Source

pub fn repr(&self) -> &DeviceRepr

Get a reference to a device’s representation data.

Source

pub fn repr_mut(&self) -> &mut DeviceRepr

Get a mutable reference to a device’s representation data.

Source

pub fn is_bus(&self) -> bool

Is this device a bus?

Source

pub fn bus_type(&self) -> BusType

Get the bus type of this device.

Source

pub fn kaction( &self, action: KactionCmd, value: u64, flags: KactionFlags, value2: u64, ) -> Result<KactionValue>

Execute a kaction operation on a device.

Source

pub fn id(&self) -> ObjID

Trait Implementations§

Source§

impl Display for Device

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more