struct PortPool {
ports_available: BTreeMap<PciAddress, PortStub>,
ports_pending: BTreeMap<PciAddress, (Receiver<()>, PortStub)>,
}
Expand description
PortPool is a pool available PCI ports where ports can be added asynchronously.
Fields§
§ports_available: BTreeMap<PciAddress, PortStub>
map of empty ports that are available
ports_pending: BTreeMap<PciAddress, (Receiver<()>, PortStub)>
map of ports that will soon be available
Implementations§
source§impl PortPool
impl PortPool
sourcefn insert(&mut self, port_stub: PortStub) -> Result<(), Error>
fn insert(&mut self, port_stub: PortStub) -> Result<(), Error>
Insert a port_stub that is available immediately.
sourcefn insert_after_notification(
&mut self,
port_stub: PortStub,
cc_recvr: Receiver<()>
) -> Result<(), Error>
fn insert_after_notification( &mut self, port_stub: PortStub, cc_recvr: Receiver<()> ) -> Result<(), Error>
Insert a port_stub that will be available after notification received. Returns immediately.
sourcefn pop_first(&mut self) -> Result<(PortStub, HotPlugAvailability), Error>
fn pop_first(&mut self) -> Result<(PortStub, HotPlugAvailability), Error>
Pop the first available port in the order of PCI enumeration. If no port is available now, pop the first in the order of PCI enumeration.
sourcefn update_port_availability(&mut self)
fn update_port_availability(&mut self)
Move pending ports to available ports if notification is received.
Auto Trait Implementations§
impl RefUnwindSafe for PortPool
impl Send for PortPool
impl !Sync for PortPool
impl Unpin for PortPool
impl UnwindSafe for PortPool
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.