Struct devices::usb::xhci::xhci_transfer::XhciTransferManager
source · pub struct XhciTransferManager {
transfers: Arc<Mutex<Vec<Weak<Mutex<XhciTransferState>>>>>,
device_slot: Weak<DeviceSlot>,
}
Expand description
Xhci Transfer manager holds reference to all ongoing transfers. Can cancel them all if needed.
Fields§
§transfers: Arc<Mutex<Vec<Weak<Mutex<XhciTransferState>>>>>
§device_slot: Weak<DeviceSlot>
Implementations§
source§impl XhciTransferManager
impl XhciTransferManager
sourcepub fn new(device_slot: Weak<DeviceSlot>) -> XhciTransferManager
pub fn new(device_slot: Weak<DeviceSlot>) -> XhciTransferManager
Create a new manager.
sourcepub fn create_transfer(
&self,
mem: GuestMemory,
port: Arc<UsbPort>,
interrupter: Arc<Mutex<Interrupter>>,
slot_id: u8,
endpoint_id: u8,
transfer_trbs: Vec<AddressedTrb>,
completion_event: Event,
stream_id: Option<u16>
) -> XhciTransfer
pub fn create_transfer( &self, mem: GuestMemory, port: Arc<UsbPort>, interrupter: Arc<Mutex<Interrupter>>, slot_id: u8, endpoint_id: u8, transfer_trbs: Vec<AddressedTrb>, completion_event: Event, stream_id: Option<u16> ) -> XhciTransfer
Build a new XhciTransfer. Endpoint id is the id in xHCI device slot.
sourcepub fn cancel_all(&self)
pub fn cancel_all(&self)
Cancel all current transfers.
fn remove_transfer(&self, t: &Arc<Mutex<XhciTransferState>>)
Trait Implementations§
source§impl Clone for XhciTransferManager
impl Clone for XhciTransferManager
source§fn clone(&self) -> XhciTransferManager
fn clone(&self) -> XhciTransferManager
Returns a copy 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 moreAuto Trait Implementations§
impl !RefUnwindSafe for XhciTransferManager
impl Send for XhciTransferManager
impl Sync for XhciTransferManager
impl Unpin for XhciTransferManager
impl !UnwindSafe for XhciTransferManager
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>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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.