pub trait DriverObject:
Sync
+ Send
+ Sized {
type Driver: Driver;
type Args;
// Required method
fn new<Ctx: DeviceContext>(
dev: &Device<Self::Driver, Ctx>,
size: usize,
args: Self::Args,
) -> impl PinInit<Self, Error>;
// Provided methods
fn open(_obj: &DriverAllocImpl<Self>, _file: &DriverFile<Self>) -> Result { ... }
fn close(_obj: &DriverAllocImpl<Self>, _file: &DriverFile<Self>) { ... }
}Expand description
GEM object functions, which must be implemented by drivers.
Required Associated Types§
Sourcetype Args
type Args
The data type to use for passing arguments to DriverObject::new.
Required Methods§
Provided Methods§
Sourcefn open(_obj: &DriverAllocImpl<Self>, _file: &DriverFile<Self>) -> Result
fn open(_obj: &DriverAllocImpl<Self>, _file: &DriverFile<Self>) -> Result
Open a new handle to an existing object, associated with a File.
Sourcefn close(_obj: &DriverAllocImpl<Self>, _file: &DriverFile<Self>)
fn close(_obj: &DriverAllocImpl<Self>, _file: &DriverFile<Self>)
Close a handle to an existing object, associated with a File.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".