pub struct PciSubregion<'a> { /* private fields */ }Expand description
A contiguous part of a PciRegion, which is itself also a PciRegion.
Simply redirects accesses to the underlying PciRegion, offset by the PciSubregion’s offset.
Also makes sure those accesses don’t exceed the PciSubregion’s end (offset + length).
Create instances of this by calling AsPciSubregion::subregion on anything that implements
it, for instance a &dyn PciRegion or OwningPciRegion.
Implementations§
Source§impl<'a> PciSubregion<'a>
impl<'a> PciSubregion<'a>
pub fn underlying_region(&self) -> &'a dyn PciRegion
pub fn offset_in_underlying_region(&self) -> u64
Trait Implementations§
Source§impl<'a> AsPciSubregion<'a> for PciSubregion<'a>
impl<'a> AsPciSubregion<'a> for PciSubregion<'a>
Source§fn as_subregion(&self) -> PciSubregion<'a>
fn as_subregion(&self) -> PciSubregion<'a>
Returns a
PciSubregion corresponding to self.Source§fn subregion(&self, range: impl RangeBounds<u64>) -> PciSubregion<'a>
fn subregion(&self, range: impl RangeBounds<u64>) -> PciSubregion<'a>
Returns a
PciSubregion corresponding to a range of self.Source§impl<'a> Clone for PciSubregion<'a>
impl<'a> Clone for PciSubregion<'a>
Source§fn clone(&self) -> PciSubregion<'a>
fn clone(&self) -> PciSubregion<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for PciSubregion<'a>
impl<'a> Debug for PciSubregion<'a>
impl<'a> Copy for PciSubregion<'a>
Auto Trait Implementations§
impl<'a> Freeze for PciSubregion<'a>
impl<'a> !RefUnwindSafe for PciSubregion<'a>
impl<'a> Send for PciSubregion<'a>
impl<'a> Sync for PciSubregion<'a>
impl<'a> Unpin for PciSubregion<'a>
impl<'a> !UnwindSafe for PciSubregion<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'a, T> PciRegion for T
impl<'a, T> PciRegion for T
Source§fn permissions(&self) -> Permissions
fn permissions(&self) -> Permissions
Whether the region may be read, written, or both.
Source§fn read_bytes(&self, offset: u64, buffer: &mut [u8]) -> Result<(), Error>
fn read_bytes(&self, offset: u64, buffer: &mut [u8]) -> Result<(), Error>
Read from a contiguous range of the region into a byte buffer. Read more