Skip to main content

DeviceIoControlIo

Struct DeviceIoControlIo 

Source
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>

Source

pub fn id(&self) -> OperationId

The identity of the in-flight operation, for cancellation or matching.

Source

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.

Trait Implementations§

Source§

impl<I: Debug, O: Debug> Debug for DeviceIoControlIo<I, O>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<I, O> Freeze for DeviceIoControlIo<I, O>
where PhantomData<fn() -> (I, O)>: Freeze,

§

impl<I, O> RefUnwindSafe for DeviceIoControlIo<I, O>

§

impl<I, O> Send for DeviceIoControlIo<I, O>
where PhantomData<fn() -> (I, O)>: Send,

§

impl<I, O> Sync for DeviceIoControlIo<I, O>
where PhantomData<fn() -> (I, O)>: Sync,

§

impl<I, O> Unpin for DeviceIoControlIo<I, O>
where PhantomData<fn() -> (I, O)>: Unpin,

§

impl<I, O> UnsafeUnpin for DeviceIoControlIo<I, O>

§

impl<I, O> UnwindSafe for DeviceIoControlIo<I, O>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.