pub struct Bus<A: BusAddress, D> { /* private fields */ }Expand description
A bus that’s agnostic to the range address type and device type.
Implementations§
Source§impl<A: BusAddress, D> Bus<A, D>
impl<A: BusAddress, D> Bus<A, D>
Sourcepub fn device(&self, addr: A) -> Option<(&BusRange<A>, &D)>
pub fn device(&self, addr: A) -> Option<(&BusRange<A>, &D)>
Return the registered range and device associated with addr.
Sourcepub fn device_mut(&mut self, addr: A) -> Option<(&BusRange<A>, &mut D)>
pub fn device_mut(&mut self, addr: A) -> Option<(&BusRange<A>, &mut D)>
Return the registered range and a mutable reference to the device
associated with addr.
Sourcepub fn register(&mut self, range: BusRange<A>, device: D) -> Result<(), Error>
pub fn register(&mut self, range: BusRange<A>, device: D) -> Result<(), Error>
Register a device with the provided range.
Sourcepub fn deregister(&mut self, addr: A) -> Option<(BusRange<A>, D)>
pub fn deregister(&mut self, addr: A) -> Option<(BusRange<A>, D)>
Deregister the device associated with addr.
Trait Implementations§
Auto Trait Implementations§
impl<A, D> Freeze for Bus<A, D>
impl<A, D> RefUnwindSafe for Bus<A, D>
impl<A, D> Send for Bus<A, D>
impl<A, D> Sync for Bus<A, D>
impl<A, D> Unpin for Bus<A, D>
impl<A, D> UnwindSafe for Bus<A, D>
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