pub struct DeviceIoControlIo<I, O> { /* private fields */ }Expand description
A pending device-control operation submitted through
AssociatedEndpoint::ioctl.
The token carries the operation’s identity and remembers both buffer types it
was submitted with, so DeviceIoControlIo::claim hands back the caller’s
own output buffer – the same value, not a copy – once the matching
completion is dequeued. The input type is carried too, because it is part of
the payload type the claim must name.
Implementations§
Source§impl<I: IoBuf, O: IoBufMut> DeviceIoControlIo<I, O>
impl<I: IoBuf, O: IoBufMut> DeviceIoControlIo<I, O>
Sourcepub fn id(&self) -> OperationId
pub fn id(&self) -> OperationId
The identity of the in-flight operation, for cancellation or matching.
Sourcepub fn claim(self, completion: &Completion) -> Result<(O, Result<usize>), Self>
pub fn claim(self, completion: &Completion) -> Result<(O, Result<usize>), Self>
Claim this operation’s result from completion.
On a match returns Ok((output, result)): output is the buffer the
caller handed over (valid up to the byte count) and result is the byte
count or the operation’s error. Returns Err(self) when completion
belongs to a different operation.
The input buffer is dropped here: the driver is done reading it, and returning both would make the common case pay for the rare one.