Skip to main content

DeviceContext

Trait DeviceContext 

Source
pub trait DeviceContext:
    Sealed
    + Send
    + Sync
    + 'static { }
Expand description

A trait implemented by all possible contexts a Device can be used in.

A Device can be in one of the following contexts:

  • Normal: The general-purpose, reference-counted context. A Device in this context may or may not be registered with userspace.
  • Ioctl: The device has been registered with userspace at some point; used in ioctl dispatch context.
  • Registered: The device is currently registered with userspace and the parent bus device is bound.

Both Device<T, Ioctl> and Device<T, Registered> dereference to Device<T> (Normal), so any method available on a Normal device is also available in the other contexts.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§