pub struct IOHIDServiceClient { /* private fields */ }hidsystem only.Expand description
IOHIDServiceClient
IOHIDServiceClient serves as a client to the HID event system
services. Users are able to copy/set specific properties (defined in
IOKit/hid/IOHIDProperties.h
), and gather more information
about the services available in the HID event system.
See also Apple’s documentation
Implementations§
Source§impl IOHIDServiceClient
impl IOHIDServiceClient
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 service.
Parameter service: the HID service to set the property on.
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 service.
Parameter service: the HID service to copy the property from.
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 IOHIDServiceClient
impl IOHIDServiceClient
Sourcepub fn registry_id(&self) -> CFRetained<CFType>
pub fn registry_id(&self) -> CFRetained<CFType>
Parameter service: the HID service to get the registry ID for.
Returns: Returns a CFTypeRef containing the registry ID for the service.
Sourcepub fn conforms_to(&self, usage_page: u32, usage: u32) -> bool
Available on crate feature libc only.
pub fn conforms_to(&self, usage_page: u32, usage: u32) -> bool
libc only.Determines if a HID service conforms to a specific usage page and usage.
Parameter usagePage: A usage page defined in
IOHIDUsageTables.h
.
Parameter usage: A usage defined in
IOHIDUsageTables.h
.
Returns: Returns true if the service conforms to the provided usage page and usage.
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 IOHIDServiceClient
impl AsRef<AnyObject> for IOHIDServiceClient
Source§impl AsRef<CFType> for IOHIDServiceClient
impl AsRef<CFType> for IOHIDServiceClient
Source§impl AsRef<IOHIDServiceClient> for IOHIDServiceClient
impl AsRef<IOHIDServiceClient> for IOHIDServiceClient
Source§impl Borrow<AnyObject> for IOHIDServiceClient
impl Borrow<AnyObject> for IOHIDServiceClient
Source§impl Borrow<CFType> for IOHIDServiceClient
impl Borrow<CFType> for IOHIDServiceClient
Source§impl ConcreteType for IOHIDServiceClient
impl ConcreteType for IOHIDServiceClient
Source§impl Debug for IOHIDServiceClient
impl Debug for IOHIDServiceClient
Source§impl Deref for IOHIDServiceClient
impl Deref for IOHIDServiceClient
Source§impl Hash for IOHIDServiceClient
impl Hash for IOHIDServiceClient
Source§impl Message for IOHIDServiceClient
impl Message for IOHIDServiceClient
Source§impl PartialEq for IOHIDServiceClient
impl PartialEq for IOHIDServiceClient
Source§impl RefEncode for IOHIDServiceClient
impl RefEncode for IOHIDServiceClient
Source§const ENCODING_REF: Encoding
const ENCODING_REF: Encoding
Source§impl Type for IOHIDServiceClient
impl Type for IOHIDServiceClient
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