KitPersonalities

Struct KitPersonalities 

Source
pub struct KitPersonalities {
    pub user_class: Option<String>,
    pub provider_class: Option<String>,
    pub class: Option<String>,
    pub user_client_class: Option<String>,
    pub user_server_name: Option<String>,
    pub property_match: Option<DefaultDictionary>,
    pub name_match: Option<Vec<String>>,
    pub resource_match: Option<String>,
    pub parent_match: Option<DefaultDictionary>,
    pub path_match: Option<String>,
    pub match_category: Option<String>,
}
Expand description

Kit Personalities

Fields§

§user_class: Option<String>

The name of your driver’s main class, which is the entry point for interacting with your driver’s code.

Include this key only in the personality dictionary of a DriverKit extension, and use it to specify the name of the custom IOService subclass that provides your driver’s behavior. When it’s time to load your driver, the system instantiates the specified class and begins the initialization and startup processes.

§Availability

  • macOS 10.14+

§Framework

  • DriverKit
§provider_class: Option<String>

The name of the class that your driver expects to provide the implementation for its provider object.

The value of this key is a string that contains the name of an IOService subclass. This class corresponds to the provider object that the system passes to your IOService subclass at startup. (For a kernel extension, the system passes the provider object to the start method of your IOService subclass. For a DriverKit extension, the system passes it to the Start method of your IOService subclass.) Use the provider object in your driver you receive to communicate with the underlying device.

§Availability

  • macOS 10.0+

§Framework

  • Kernel
§class: Option<String>

The name of the class to instantiate from your driver.

The value of this key is a string that contains the name of a custom IOService subclass in your driver. When the system successfully matches one of your driver’s personalities to a device, it instantiates the class in this key and calls its start method.

For the personalities in a DriverKit extension, specify the value IOUserService unless otherwise directed by the documentation. For example, the IOUserHIDEventService class expects you to specify the value AppleUserHIDEventService.

§Availability

  • macOS 10.0+

§Framework

  • Kernel
§user_client_class: Option<String>

The name of the class to instantiate when the system requires a client connection to the driver.

The value of this key is a string that contains the name of an IOService subclass in your driver.

§Availability

  • macOS 10.0+

§Framework

  • Kernel
§user_server_name: Option<String>

The name that the system uses to facilitate communication between your driver and other clients.

Typically, you set the value of this key to your kext or DriverKit extension’s bundle identifier. The system registers your driver under the specified server name, and uses that name to facilitate communications between your driver and other clients, including the kernel itself.

§Availability

  • macOS 10.14+

§Framework

  • DriverKit
§property_match: Option<DefaultDictionary>

The device-specific keys the system must match in order to use your driver.

The value of this key is a dictionary of device-specific keys and values to use during the matching process. For the system to match the driver personality to a device, all keys in the dictionary must be present in the device, and all values must exactly match the device-provided values.

§Availability

  • macOS 10.0+

§Framework

  • Kernel
§name_match: Option<Vec<String>>

One or more strings that contain the names of possible provider objects in the system registry.

The value of this key is a string or an array of strings. The system begins the matching process with a provider object, and looks for additional drivers or nubs that support that provider object. When this key is present, the system compares its values to the provider object’s name. (It also compares the strings to the provider’s compatible and device_type properties.) If it doesn’t find any matches, the system doesn’t match the driver to the provider object.

The default name of a provider object is its class name, but providers may register a custom name. For more information about how to set or get information for registered services, see IORegistryEntry.

§Availability

  • macOS 10.0+

§Framework

  • Kernel
§resource_match: Option<String>

One or more system-specific or device-specific resources that your driver requires.

The value of this key is a string or an array of strings. Each string contains the name of a resource that must be published in the global resource list before the system loads the driver. For example, specify IOBSD to prevent the system from loading your driver until after the BSD kernel is available.

To access the list of global resources, call the getResourceService method of IOService. To publish custom resources from your driver, call the publishResource method.

§Availability

  • macOS 10.0+

§Framework

  • Kernel
§parent_match: Option<DefaultDictionary>

§Availability

  • macOS 10.0+

§Framework

  • Kernel
§path_match: Option<String>

§Availability

  • macOS 10.0+

§Framework

  • Kernel
§match_category: Option<String>

§Availability

  • macOS 10.0+

§Framework

  • Kernel

Trait Implementations§

Source§

impl Clone for KitPersonalities

Source§

fn clone(&self) -> KitPersonalities

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for KitPersonalities

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for KitPersonalities

Source§

fn default() -> KitPersonalities

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for KitPersonalities

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for KitPersonalities

Source§

fn eq(&self, other: &KitPersonalities) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for KitPersonalities

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for KitPersonalities

Source§

impl StructuralPartialEq for KitPersonalities

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,