pub struct IOHIDEventSystemClient { /* private fields */ }hidsystem only.Expand description
IOHIDEventSystemClient
IOHIDEventSystemClient serves as a client that can be used
for reading/writing specific properties of the HID event system, as
well as getting services of the HID event system. A list of accessible
properties can be found in
IOKit/hid/IOHIDProperties.h
.
See also: IOKit/hidsystem/IOHIDServiceClient.h
See also Apple’s documentation
Implementations§
Source§impl IOHIDEventSystemClient
impl IOHIDEventSystemClient
Sourcepub fn new_simple_client(
allocator: Option<&CFAllocator>,
) -> CFRetained<IOHIDEventSystemClient>
pub fn new_simple_client( allocator: Option<&CFAllocator>, ) -> CFRetained<IOHIDEventSystemClient>
Creates a client of the HID event system that has to ability to read/write certain properties.
Certain properties have the ability to be set/read by clients, see
IOHIDProperties.h
for a list of these properties.
Parameter allocator: a custom allocator reference to be used for allocation of the result.
Returns: Returns a
IOHIDEventSystemClientRef
on success.
Caller should CFRelease the client when they are finished with it, or keep a
reference to the client if multiple properties need to be set/read.
Sourcepub unsafe fn set_property(&self, key: &CFString, property: &CFType) -> bool
pub unsafe fn set_property(&self, key: &CFString, property: &CFType) -> bool
Sets a property on the HID event system.
Parameter client: the HID client that created via
IOHIDEventSystemClientCreateSimpleClient()
.
Parameter key: the property key to set. A list of keys can be found in
HIDProperties.h
.
Parameter property: the value to set the property.
Returns: Returns true on success.
§Safety
property should be of the correct type.
Sourcepub fn property(&self, key: &CFString) -> Option<CFRetained<CFType>>
pub fn property(&self, key: &CFString) -> Option<CFRetained<CFType>>
Copies a property from the HID event system.
Parameter client: the HID client created via
IOHIDEventSystemClientCreateSimpleClient()
.
Parameter key: the property key to copy. A list of keys can be found in
HIDProperties.h
.
Returns: Returns a CFTypeRef of the property to be copied on success, otherwise NULL. Caller is responsible for calling CFRelease on the property.
Source§impl IOHIDEventSystemClient
impl IOHIDEventSystemClient
Sourcepub fn services(&self) -> Option<CFRetained<CFArray>>
pub fn services(&self) -> Option<CFRetained<CFArray>>
Copies all services available to the client.
Useful for seeing services that are available. Clients can further probe
the services with the APIs available in
IOHIDServiceClient.h
.
Parameter client: the HID client that created via
IOHIDEventSystemClientCreateSimpleClient()
.
Returns: On success, returns a CFArrayRef of
IOHIDServiceClientRefs
that are
available to the client. Caller is responsible for releasing the array.
Methods from Deref<Target = CFType>§
Sourcepub fn downcast_ref<T>(&self) -> Option<&T>where
T: ConcreteType,
pub fn downcast_ref<T>(&self) -> Option<&T>where
T: ConcreteType,
Attempt to downcast the type to that of type T.
This is the reference-variant. Use CFRetained::downcast if you
want to convert a retained type. See also ConcreteType for more
details on which types support being converted to.
Sourcepub fn retain_count(&self) -> usize
pub fn retain_count(&self) -> usize
Get the reference count of the object.
This function may be useful for debugging. You normally do not use this function otherwise.
Beware that some things (like CFNumbers, small CFStrings etc.) may
not have a normal retain count for optimization purposes, and can
return usize::MAX in that case.
Trait Implementations§
Source§impl AsRef<AnyObject> for IOHIDEventSystemClient
impl AsRef<AnyObject> for IOHIDEventSystemClient
Source§impl AsRef<CFType> for IOHIDEventSystemClient
impl AsRef<CFType> for IOHIDEventSystemClient
Source§impl Borrow<AnyObject> for IOHIDEventSystemClient
impl Borrow<AnyObject> for IOHIDEventSystemClient
Source§impl Borrow<CFType> for IOHIDEventSystemClient
impl Borrow<CFType> for IOHIDEventSystemClient
Source§impl Debug for IOHIDEventSystemClient
impl Debug for IOHIDEventSystemClient
Source§impl Deref for IOHIDEventSystemClient
impl Deref for IOHIDEventSystemClient
Source§impl Hash for IOHIDEventSystemClient
impl Hash for IOHIDEventSystemClient
Source§impl Message for IOHIDEventSystemClient
impl Message for IOHIDEventSystemClient
Source§impl PartialEq for IOHIDEventSystemClient
impl PartialEq for IOHIDEventSystemClient
Source§impl RefEncode for IOHIDEventSystemClient
impl RefEncode for IOHIDEventSystemClient
Source§const ENCODING_REF: Encoding
const ENCODING_REF: Encoding
Source§impl Type for IOHIDEventSystemClient
impl Type for IOHIDEventSystemClient
Source§fn retain(&self) -> CFRetained<Self>where
Self: Sized,
fn retain(&self) -> CFRetained<Self>where
Self: Sized,
Source§fn as_concrete_TypeRef(&self) -> &Self
fn as_concrete_TypeRef(&self) -> &Self
core-foundation crate.Source§unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
core-foundation crate. Read moreSource§fn as_CFTypeRef(&self) -> &CFType
fn as_CFTypeRef(&self) -> &CFType
core-foundation crate.Source§unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
core-foundation crate. Read more