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.
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.
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.
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.
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.
Trait Implementations§
source§impl Ord for Opcode
impl Ord for Opcode
source§impl PartialOrd for Opcode
impl PartialOrd for Opcode
impl 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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)