pub struct Opcode { /* private fields */ }
Expand description
The opcode used by an Ioctl
.
Implementations§
source§impl Opcode
impl Opcode
sourcepub const fn old(raw: RawOpcode) -> Self
pub const fn old(raw: RawOpcode) -> Self
Create a new old Opcode
from a raw opcode.
Rather than being a composition of several attributes, old opcodes are just numbers. In general most drivers follow stricter conventions, but older drivers may still use this strategy.
sourcepub const fn from_components(
direction: Direction,
group: u8,
number: u8,
data_size: usize,
) -> Self
pub const fn from_components( direction: Direction, group: u8, number: u8, data_size: usize, ) -> Self
Create a new opcode from a direction, group, number, and size.
This corresponds to the C macro _IOC(direction, group, number, size)
sourcepub const fn none<T>(group: u8, number: u8) -> Self
pub const fn none<T>(group: u8, number: u8) -> Self
Create a new non-mutating opcode from a group, a number, and the type of data.
This corresponds to the C macro _IO(group, number)
when T
is zero
sized.
sourcepub const fn read<T>(group: u8, number: u8) -> Self
pub const fn read<T>(group: u8, number: u8) -> Self
Create a new reading opcode from a group, a number and the type of data.
This corresponds to the C macro _IOR(group, number, T)
.
sourcepub const fn write<T>(group: u8, number: u8) -> Self
pub const fn write<T>(group: u8, number: u8) -> Self
Create a new writing opcode from a group, a number and the type of data.
This corresponds to the C macro _IOW(group, number, T)
.
sourcepub const fn read_write<T>(group: u8, number: u8) -> Self
pub const fn read_write<T>(group: u8, number: u8) -> Self
Create a new reading and writing opcode from a group, a number and the type of data.
This corresponds to the C macro _IOWR(group, number, T)
.
Trait Implementations§
source§impl Ord for Opcode
impl Ord for Opcode
source§impl PartialEq for Opcode
impl PartialEq for Opcode
source§impl PartialOrd for Opcode
impl PartialOrd for Opcode
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Opcode
impl Eq for Opcode
impl StructuralPartialEq for Opcode
Auto Trait Implementations§
impl Freeze for Opcode
impl RefUnwindSafe for Opcode
impl Send for Opcode
impl Sync for Opcode
impl Unpin for Opcode
impl UnwindSafe for Opcode
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
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)