pub unsafe trait IoctlReq<'a, Device: IoDevice>: Copy {
type ExtArg
where Self: 'a;
type TempMem;
type RawArg: AsRawV;
type Result
where Self: 'a;
// Required methods
fn prepare_ioctl_args(
&self,
arg: &Self::ExtArg,
temp_mem: &mut MaybeUninit<Self::TempMem>,
) -> (ulong, Self::RawArg);
fn prepare_ioctl_result(
&self,
raw: int,
arg: &Self::ExtArg,
temp_mem: &MaybeUninit<Self::TempMem>,
) -> Self::Result;
}
Expand description
Represents a particular request that can be issue with the ioctl
system call.
Safety: Implementers must ensure that they only generate valid combinations
of ioctl
request and raw argument.
Required Associated Types§
Sourcetype ExtArg
where
Self: 'a
type ExtArg where Self: 'a
The type that the caller will provide when using this ioctl
command.
Use ()
for requests that don’t need a caller-provided argument, such
as those which only return some data.
Required Methods§
Sourcefn prepare_ioctl_args(
&self,
arg: &Self::ExtArg,
temp_mem: &mut MaybeUninit<Self::TempMem>,
) -> (ulong, Self::RawArg)
fn prepare_ioctl_args( &self, arg: &Self::ExtArg, temp_mem: &mut MaybeUninit<Self::TempMem>, ) -> (ulong, Self::RawArg)
Prepare the cmd
and arg
values for a ioctl
system call.
The arg
parameter is the argument provided by the caller of the
super::File::ioctl
function. temp_mem
is a reference to
uninitialized memory of appropriate size and alignment for
Self::TempMem
, which the implementer can either leave uninitialized
for the kernel to populate or pre-initialize with data the
kernel will expect to find there.
Sourcefn prepare_ioctl_result(
&self,
raw: int,
arg: &Self::ExtArg,
temp_mem: &MaybeUninit<Self::TempMem>,
) -> Self::Result
fn prepare_ioctl_result( &self, raw: int, arg: &Self::ExtArg, temp_mem: &MaybeUninit<Self::TempMem>, ) -> Self::Result
Prepare a raw successful result from a ioctl
call to be returned.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.