Skip to main content

Arg

Enum Arg 

Source
pub enum Arg<'a> {
    Read(&'a Buffer, usize),
    Write(&'a mut Buffer, usize),
    Bytes(&'a [u8]),
    Same(usize, usize),
}
Expand description

A kernel argument, bound to the slot of its position in the argument list.

Variants§

§

Read(&'a Buffer, usize)

A buffer the kernel only reads, from byte offset on.

§

Write(&'a mut Buffer, usize)

A buffer the kernel writes (and may read), from byte offset on.

§

Bytes(&'a [u8])

Small constant data copied into the command stream (at most 4 KiB).

§

Same(usize, usize)

The buffer of the buffer argument at this index bound again, from byte offset on: an in-place kernel reading and writing one buffer through two slots. Hazards are those of that argument (bind it as Arg::Write).

Implementations§

Source§

impl<'a> Arg<'a>

Source

pub fn read(buffer: &'a Buffer) -> Self

The whole buffer, read-only.

Source

pub fn write(buffer: &'a mut Buffer) -> Self

The whole buffer, written.

Source

pub fn bytes(bytes: &'a [u8]) -> Self

Inline constant bytes.

Trait Implementations§

Source§

impl<'a> Debug for Arg<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Arg<'a>

§

impl<'a> !UnwindSafe for Arg<'a>

§

impl<'a> Freeze for Arg<'a>

§

impl<'a> Send for Arg<'a>

§

impl<'a> Sync for Arg<'a>

§

impl<'a> Unpin for Arg<'a>

§

impl<'a> UnsafeUnpin for Arg<'a>

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> AutoreleaseSafe for T
where T: ?Sized,

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, !>

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.