IOHIDDevice

Struct IOHIDDevice 

Source
pub struct IOHIDDevice { /* private fields */ }
Available on crate feature hid only.
Expand description

This is the type of a reference to the IOHIDDevice.

See also Apple’s documentation

Implementations§

Source§

impl IOHIDDevice

Source

pub fn new( allocator: Option<&CFAllocator>, service: io_service_t, ) -> Option<CFRetained<IOHIDDevice>>

Available on crate feature libc only.

Creates an element from an io_service_t.

The io_service_t passed in this method must reference an object in the kernel of type IOHIDDevice.

Parameter allocator: Allocator to be used during creation.

Parameter service: Reference to service object in the kernel.

Returns: Returns a new IOHIDDeviceRef.

Source

pub fn service(&self) -> io_service_t

Available on crate feature libc only.

Returns the io_service_t for an IOHIDDevice, if it has one.

If the IOHIDDevice references an object in the kernel, this is used to get the io_service_t for that object.

Parameter device: Reference to an IOHIDDevice.

Returns: Returns the io_service_t if the IOHIDDevice has one, or MACH_PORT_NULL if it does not.

Source

pub fn open(&self, options: IOOptionBits) -> IOReturn

Opens a HID device for communication.

Before the client can issue commands that change the state of the device, it must have succeeded in opening the device. This establishes a link between the client’s task and the actual device. To establish an exclusive link use the kIOHIDOptionsTypeSeizeDevice option.

Parameter device: Reference to an IOHIDDevice.

Parameter options: Option bits to be sent down to the device.

Returns: Returns kIOReturnSuccess if successful.

Source

pub fn close(&self, options: IOOptionBits) -> IOReturn

Closes communication with a HID device.

This closes a link between the client’s task and the actual device.

Parameter device: Reference to an IOHIDDevice.

Parameter options: Option bits to be sent down to the device.

Returns: Returns kIOReturnSuccess if successful.

Source

pub fn conforms_to(&self, usage_page: u32, usage: u32) -> bool

Convenience function that scans the Application Collection elements to see if it conforms to the provided usagePage and usage.

Examples of Application Collection usages pairs are:
usagePage = kHIDPage_GenericDesktop
usage = kHIDUsage_GD_Mouse
or
usagePage = kHIDPage_GenericDesktop
usage = kHIDUsage_GD_Keyboard

Parameter device: Reference to an IOHIDDevice.

Parameter usagePage: Device usage page

Parameter usage: Device usage

Returns: Returns TRUE if device conforms to provided usage.

Source

pub fn property(&self, key: &CFString) -> Option<CFRetained<CFType>>

Obtains a property from an IOHIDDevice.

Property keys are prefixed by kIOHIDDevice and declared in <IOKit /hid/IOHIDKeys.h>.

Parameter device: Reference to an IOHIDDevice.

Parameter key: CFStringRef containing key to be used when querying the device.

Returns: Returns CFTypeRef containing the property.

Source

pub unsafe fn set_property(&self, key: &CFString, property: &CFType) -> bool

Sets a property for an IOHIDDevice.

Property keys are prefixed by kIOHIDDevice and declared in <IOKit /hid/IOHIDKeys.h>.

Parameter device: Reference to an IOHIDDevice.

Parameter key: CFStringRef containing key to be used when modifiying the device property.

Parameter property: CFTypeRef containg the property to be set.

Returns: Returns TRUE if successful.

§Safety

property should be of the correct type.

Source

pub unsafe fn matching_elements( &self, matching: Option<&CFDictionary>, options: IOOptionBits, ) -> Option<CFRetained<CFArray>>

Obtains HID elements that match the criteria contained in the matching dictionary.

Matching keys are prefixed by kIOHIDElement and declared in <IOKit /hid/IOHIDKeys.h>. Passing a NULL dictionary will result in all device elements being returned.

Parameter device: Reference to an IOHIDDevice.

Parameter matching: CFDictionaryRef containg element matching criteria.

Parameter options: Reserved for future use.

Returns: Returns CFArrayRef containing multiple IOHIDElement object.

§Safety

matching generics must be of the correct type.

Source

pub unsafe fn schedule_with_run_loop( &self, run_loop: &CFRunLoop, run_loop_mode: &CFString, )

Schedules HID device with run loop.

Formally associates device with client’s run loop. Scheduling this device with the run loop is necessary before making use of any asynchronous APIs.

Parameter device: Reference to an IOHIDDevice.

Parameter runLoop: RunLoop to be used when scheduling any asynchronous activity.

Parameter runLoopMode: Run loop mode to be used when scheduling any asynchronous activity.

§Safety

run_loop possibly has additional threading requirements.

Source

pub unsafe fn unschedule_from_run_loop( &self, run_loop: &CFRunLoop, run_loop_mode: &CFString, )

Unschedules HID device with run loop.

Formally disassociates device with client’s run loop.

Parameter device: Reference to an IOHIDDevice.

Parameter runLoop: RunLoop to be used when unscheduling any asynchronous activity.

Parameter runLoopMode: Run loop mode to be used when unscheduling any asynchronous activity.

§Safety

run_loop possibly has additional threading requirements.

Source

pub unsafe fn set_dispatch_queue(&self, queue: &DispatchQueue)

Available on crate feature dispatch2 only.

Sets the dispatch queue to be associated with the IOHIDDevice. This is necessary in order to receive asynchronous events from the kernel.

An IOHIDDevice should not be associated with both a runloop and dispatch queue. A call to IOHIDDeviceSetDispatchQueue should only be made once. After a dispatch queue is set, the IOHIDDevice must make a call to activate via IOHIDDeviceActivate and cancel via IOHIDDeviceCancel. All calls to “Register” functions should be done before activation and not after cancellation.

Parameter device: Reference to an IOHIDDevice

Parameter queue: The dispatch queue to which the event handler block will be submitted.

§Safety

queue possibly has additional threading requirements.

Source

pub unsafe fn set_cancel_handler(&self, handler: dispatch_block_t)

Available on crate feature dispatch2 only.

Sets a cancellation handler for the dispatch queue associated with IOHIDDeviceSetDispatchQueue.

The cancellation handler (if specified) will be will be submitted to the device’s dispatch queue in response to a call to IOHIDDeviceCancel after all the events have been handled. IOHIDDeviceSetCancelHandler should not be used when scheduling with a run loop. The IOHIDDeviceRef should only be released after the device has been cancelled, and the cancel handler has been called. This is to ensure all asynchronous objects are released. For example: dispatch_block_t cancelHandler = dispatch_block_create(0, ^{ CFRelease(device); }); IOHIDDeviceSetCancelHandler(device, cancelHandler); IOHIDDeviceActivate(device); IOHIDDeviceCancel(device);

Parameter device: Reference to an IOHIDDevice.

Parameter handler: The cancellation handler block to be associated with the dispatch queue.

§Safety

handler must be a valid pointer.

Source

pub fn activate(&self)

Activates the IOHIDDevice object.

An IOHIDDevice object associated with a dispatch queue is created in an inactive state. The object must be activated in order to receive asynchronous events from the kernel. A dispatch queue must be set via IOHIDDeviceSetDispatchQueue before activation. An activated device must be cancelled via IOHIDDeviceCancel. All calls to “Register” functions should be done before activation and not after cancellation. Calling IOHIDDeviceActivate on an active IOHIDDevice has no effect.

Parameter device: Reference to an IOHIDDevice

Source

pub fn cancel(&self)

Cancels the IOHIDDevice preventing any further invocation of its event handler block.

Cancelling prevents any further invocation of the event handler block for the specified dispatch queue, but does not interrupt an event handler block that is already in progress. Explicit cancellation of the IOHIDDevice is required, no implicit cancellation takes place. Calling IOHIDDeviceCancel on an already cancelled queue has no effect. The IOHIDDeviceRef should only be released after the device has been cancelled, and the cancel handler has been called. This is to ensure all asynchronous objects are released. For example: dispatch_block_t cancelHandler = dispatch_block_create(0, ^{ CFRelease(device); }); IOHIDDeviceSetCancelHandler(device, cancelHandler); IOHIDDeviceActivate(device); IOHIDDeviceCancel(device);

Parameter device: Reference to an IOHIDDevice

Source

pub unsafe fn register_removal_callback( &self, callback: IOHIDCallback, context: *mut c_void, )

Registers a callback to be used when a IOHIDDevice is removed.

In most cases this occurs when a device is unplugged. If a dispatch queue is set, this call must occur before activation.

Parameter device: Reference to an IOHIDDevice.

Parameter callback: Pointer to a callback method of type IOHIDCallback.

Parameter context: Pointer to data to be passed to the callback.

§Safety
  • callback must be implemented correctly.
  • context must be a valid pointer or null.
Source

pub unsafe fn register_input_value_callback( &self, callback: IOHIDValueCallback, context: *mut c_void, )

Registers a callback to be used when an input value is issued by the device.

An input element refers to any element of type kIOHIDElementTypeInput and is usually issued by interrupt driven reports. If more specific element values are desired, you can specify matching criteria via IOHIDDeviceSetInputValueMatching and IOHIDDeviceSetInputValueMatchingMultiple. If a dispatch queue is set, this call must occur before activation.

Parameter device: Reference to an IOHIDDevice.

Parameter callback: Pointer to a callback method of type IOHIDValueCallback.

Parameter context: Pointer to data to be passed to the callback.

§Safety
  • callback must be implemented correctly.
  • context must be a valid pointer or null.
Source

pub unsafe fn register_input_report_callback( &self, report: NonNull<u8>, report_length: CFIndex, callback: IOHIDReportCallback, context: *mut c_void, )

Registers a callback to be used when an input report is issued by the device.

An input report is an interrupt driver report issued by the device. If a dispatch queue is set, this call must occur before activation.

Parameter device: Reference to an IOHIDDevice.

Parameter report: Pointer to preallocated buffer in which to copy inbound report data.

Parameter reportLength: Length of preallocated buffer.

Parameter callback: Pointer to a callback method of type IOHIDReportCallback.

Parameter context: Pointer to data to be passed to the callback.

§Safety
  • report must be a valid pointer.
  • callback must be implemented correctly.
  • context must be a valid pointer or null.
Source

pub unsafe fn register_input_report_with_time_stamp_callback( &self, report: NonNull<u8>, report_length: CFIndex, callback: IOHIDReportWithTimeStampCallback, context: *mut c_void, )

Registers a timestamped callback to be used when an input report is issued by the device.

An input report is an interrupt driver report issued by the device. If a dispatch queue is set, this call must occur before activation.

Parameter device: Reference to an IOHIDDevice.

Parameter report: Pointer to preallocated buffer in which to copy inbound report data.

Parameter reportLength: Length of preallocated buffer.

Parameter callback: Pointer to a callback method of type IOHIDReportWithTimeStampCallback.

Parameter context: Pointer to data to be passed to the callback.

§Safety
  • report must be a valid pointer.
  • callback must be implemented correctly.
  • context must be a valid pointer or null.
Source

pub unsafe fn set_input_value_matching(&self, matching: Option<&CFDictionary>)

Sets matching criteria for input values received via IOHIDDeviceRegisterInputValueCallback.

Matching keys are prefixed by kIOHIDElement and declared in <IOKit /hid/IOHIDKeys.h>. Passing a NULL dictionary will result in all devices being enumerated. Any subsequent calls will cause the hid manager to release previously matched input elements and restart the matching process using the revised criteria. If interested in multiple, specific device elements, please defer to using IOHIDDeviceSetInputValueMatchingMultiple. If a dispatch queue is set, this call must occur before activation.

Parameter device: Reference to an IOHIDDevice.

Parameter matching: CFDictionaryRef containg device matching criteria.

§Safety

matching generics must be of the correct type.

Source

pub unsafe fn set_input_value_matching_multiple( &self, multiple: Option<&CFArray>, )

Sets multiple matching criteria for input values received via IOHIDDeviceRegisterInputValueCallback.

Matching keys are prefixed by kIOHIDElement and declared in <IOKit /hid/IOHIDKeys.h>. This method is useful if interested in multiple, specific elements. If a dispatch queue is set, this call must occur before activation.

Parameter device: Reference to an IOHIDDevice.

Parameter multiple: CFArrayRef containing multiple CFDictionaryRef objects containg input element matching criteria.

§Safety

multiple generic must be of the correct type.

Source

pub fn set_value(&self, element: &IOHIDElement, value: &IOHIDValue) -> IOReturn

Sets a value for an element.

This method behaves synchronously and will block until the report has been issued to the device. It is only relevent for either output or feature type elements. If setting values for multiple elements you may want to consider using IOHIDDeviceSetValueMultiple or IOHIDTransaction.

Parameter device: Reference to an IOHIDDevice.

Parameter element: IOHIDElementRef whose value is to be modified.

Parameter value: IOHIDValueRef containing value to be set.

Returns: Returns kIOReturnSuccess if successful.

Source

pub unsafe fn set_value_multiple(&self, multiple: &CFDictionary) -> IOReturn

Sets multiple values for multiple elements.

This method behaves synchronously and will block until the report has been issued to the device. It is only relevent for either output or feature type elements.

Parameter device: Reference to an IOHIDDevice.

Parameter multiple: CFDictionaryRef where key is IOHIDElementRef and value is IOHIDValueRef.

Returns: Returns kIOReturnSuccess if successful.

§Safety

multiple generics must be of the correct type.

Source

pub unsafe fn set_value_with_callback( &self, element: &IOHIDElement, value: &IOHIDValue, timeout: CFTimeInterval, callback: IOHIDValueCallback, context: *mut c_void, ) -> IOReturn

Sets a value for an element.

This method currently only behaves synchronously and will not invoke the callback. It is only relevent for either output or feature type elements. If setting values for multiple elements you may want to consider using IOHIDDeviceSetValueMultipleWithCallback or IOHIDTransaction.

Parameter device: Reference to an IOHIDDevice.

Parameter element: IOHIDElementRef whose value is to be modified.

Parameter value: IOHIDValueRef containing value to be set.

Parameter timeout: Currently unused.

Parameter callback: Currently unused.

Parameter context: Pointer to data to be passed to the callback.

Returns: Returns kIOReturnSuccess if successful.

§Safety
  • callback must be implemented correctly.
  • context must be a valid pointer or null.
Source

pub unsafe fn set_value_multiple_with_callback( &self, multiple: &CFDictionary, timeout: CFTimeInterval, callback: IOHIDValueMultipleCallback, context: *mut c_void, ) -> IOReturn

Sets multiple values for multiple elements and returns status via a completion callback.

This method behaves asynchronously and will invoke the callback once the report has been issued to the device. It is only relevent for either output or feature type elements.

Parameter device: Reference to an IOHIDDevice.

Parameter multiple: CFDictionaryRef where key is IOHIDElementRef and value is IOHIDValueRef.

Parameter timeout: CFTimeInterval containing the timeout in milliseconds.

Parameter callback: Pointer to a callback method of type IOHIDValueMultipleCallback.

Parameter context: Pointer to data to be passed to the callback.

Returns: Returns kIOReturnSuccess if successful.

§Safety
  • multiple generics must be of the correct type.
  • callback must be implemented correctly.
  • context must be a valid pointer or null.
Source

pub unsafe fn value( &self, element: &IOHIDElement, p_value: NonNull<NonNull<IOHIDValue>>, ) -> IOReturn

Gets a value for an element.

This method behaves synchronously and returns immediately for input type elements. If requesting a value for a feature element, this will block until the report has been issued to the device. If obtaining values for multiple elements you may want to consider using IOHIDDeviceCopyValueMultiple or IOHIDTransaction.

Parameter device: Reference to an IOHIDDevice.

Parameter element: IOHIDElementRef whose value is to be obtained.

Parameter pValue: Pointer to IOHIDValueRef to be obtained.

Returns: Returns kIOReturnSuccess if successful.

§Safety

p_value must be a valid pointer.

Source§

impl IOHIDDevice

Source

pub unsafe fn value_with_options( &self, element: &IOHIDElement, p_value: NonNull<NonNull<IOHIDValue>>, options: u32, ) -> IOReturn

Gets a value for an element.

This method behaves synchronously and returns immediately for input type elements. If requesting a value for a feature element, this will block until the report has been issued to the device. If obtaining values for multiple elements you may want to consider using IOHIDDeviceCopyValueMultiple or IOHIDTransaction.

Parameter device: Reference to an IOHIDDevice.

Parameter element: IOHIDElementRef whose value is to be obtained.

Parameter pValue: Pointer to IOHIDValueRef to be obtained.

Parameter options: (see IOHIDDeviceGetValueOptions).

Returns: Returns kIOReturnSuccess if successful.

§Safety

p_value must be a valid pointer.

Source

pub unsafe fn copy_value_multiple( &self, elements: &CFArray, p_multiple: *mut *const CFDictionary, ) -> IOReturn

Copies a values for multiple elements.

This method behaves synchronously and returns immediately for input type elements. If requesting a value for a feature element, this will block until the report has been issued to the device.

Parameter device: Reference to an IOHIDDevice.

Parameter elements: CFArrayRef containing multiple IOHIDElementRefs whose values are to be obtained.

Parameter pMultiple: Pointer to CFDictionaryRef where the keys are the provided elements and the values are the requested values.

Returns: Returns kIOReturnSuccess if successful.

§Safety
  • elements generic must be of the correct type.
  • p_multiple must be a valid pointer or null.
Source

pub unsafe fn value_with_callback( &self, element: &IOHIDElement, p_value: NonNull<NonNull<IOHIDValue>>, timeout: CFTimeInterval, callback: IOHIDValueCallback, context: *mut c_void, ) -> IOReturn

Gets a value for an element.

This method currently only behaves synchronously and will not invoke the callback. It is only relevent for either output or feature type elements. If setting values for multiple elements you may want to consider using IOHIDDeviceCopyValueMultipleWithCallback or IOHIDTransaction.

Parameter device: Reference to an IOHIDDevice.

Parameter element: IOHIDElementRef whose value is to be obtained.

Parameter pValue: Pointer to IOHIDValueRef to be passedback.

Parameter timeout: Currently unused.

Parameter callback: Currently unused.

Parameter context: Pointer to data to be passed to the callback.

Returns: Returns kIOReturnSuccess if successful.

§Safety
  • p_value must be a valid pointer.
  • callback must be implemented correctly.
  • context must be a valid pointer or null.
Source

pub unsafe fn copy_value_multiple_with_callback( &self, elements: &CFArray, p_multiple: *mut *const CFDictionary, timeout: CFTimeInterval, callback: IOHIDValueMultipleCallback, context: *mut c_void, ) -> IOReturn

Copies a values for multiple elements and returns status via a completion callback.

This method behaves asynchronusly and is only relevent for either output or feature type elements.

Parameter device: Reference to an IOHIDDevice.

Parameter elements: CFArrayRef containing multiple IOHIDElementRefs whose values are to be obtained.

Parameter pMultiple: Pointer to CFDictionaryRef where the keys are the provided elements and the values are the requested values.

Parameter timeout: CFTimeInterval containing the timeout in milliseconds.

Parameter callback: Pointer to a callback method of type IOHIDValueMultipleCallback.

Parameter context: Pointer to data to be passed to the callback.

Returns: Returns kIOReturnSuccess if successful.

§Safety
  • elements generic must be of the correct type.
  • p_multiple must be a valid pointer or null.
  • callback must be implemented correctly.
  • context must be a valid pointer or null.
Source

pub unsafe fn set_report( &self, report_type: IOHIDReportType, report_id: CFIndex, report: NonNull<u8>, report_length: CFIndex, ) -> IOReturn

Sends a report to the device.

This method behaves synchronously and will block until the report has been issued to the device. It is only relevent for either output or feature type reports.

Parameter device: Reference to an IOHIDDevice.

Parameter reportType: Type of report being sent.

Parameter reportID: ID of the report being sent. If the device supports multiple reports, this should also be set in the first byte of the report.

Parameter report: The report bytes to be sent to the device.

Parameter reportLength: The length of the report to be sent to the device.

Returns: Returns kIOReturnSuccess if successful.

§Safety

report must be a valid pointer.

Source

pub unsafe fn set_report_with_callback( &self, report_type: IOHIDReportType, report_id: CFIndex, report: NonNull<u8>, report_length: CFIndex, timeout: CFTimeInterval, callback: IOHIDReportCallback, context: *mut c_void, ) -> IOReturn

Sends a report to the device.

This method behaves asynchronously. It is only relevent for either output or feature type reports.

Parameter device: Reference to an IOHIDDevice.

Parameter reportType: Type of report being sent.

Parameter reportID: ID of the report being sent. If the device supports multiple reports, this should also be set in the first byte of the report.

Parameter report: The report bytes to be sent to the device.

Parameter reportLength: The length of the report to be sent to the device.

Parameter timeout: CFTimeInterval containing the timeout in milliseconds.

Parameter callback: Pointer to a callback method of type IOHIDReportCallback.

Parameter context: Pointer to data to be passed to the callback.

Returns: Returns kIOReturnSuccess if successful.

§Safety
  • report must be a valid pointer.
  • callback must be implemented correctly.
  • context must be a valid pointer or null.
Source

pub unsafe fn report( &self, report_type: IOHIDReportType, report_id: CFIndex, report: NonNull<u8>, p_report_length: NonNull<CFIndex>, ) -> IOReturn

Obtains a report from the device.

This method behaves synchronously and will block until the report has been received from the device. It is only relevent for either output or feature type reports. Please defer to using IOHIDDeviceRegisterInputReportCallback for obtaining input reports.

Parameter device: Reference to an IOHIDDevice.

Parameter reportType: Type of report being requested.

Parameter reportID: ID of the report being requested.

Parameter report: Pointer to preallocated buffer in which to copy inbound report data.

Parameter pReportLength: Pointer to length of preallocated buffer. This value will be modified to refect the length of the returned report.

Returns: Returns kIOReturnSuccess if successful.

§Safety
  • report must be a valid pointer.
  • p_report_length must be a valid pointer.
Source

pub unsafe fn report_with_callback( &self, report_type: IOHIDReportType, report_id: CFIndex, report: NonNull<u8>, p_report_length: NonNull<CFIndex>, timeout: CFTimeInterval, callback: IOHIDReportCallback, context: NonNull<c_void>, ) -> IOReturn

Obtains a report from the device.

This method behaves asynchronously. It is only relevent for either output or feature type reports. Please defer to using IOHIDDeviceRegisterInputReportCallback for obtaining input reports.

Parameter device: Reference to an IOHIDDevice.

Parameter reportType: Type of report being requested.

Parameter reportID: ID of the report being requested.

Parameter report: Pointer to preallocated buffer in which to copy inbound report data.

Parameter pReportLength: Pointer to length of preallocated buffer. This value will be modified to refect the length of the returned report.

Parameter timeout: CFTimeInterval containing the timeout in milliseconds.

Parameter callback: Pointer to a callback method of type IOHIDReportCallback.

Parameter context: Pointer to data to be passed to the callback.

Returns: Returns kIOReturnSuccess if successful.

§Safety
  • report must be a valid pointer.
  • p_report_length must be a valid pointer.
  • callback must be implemented correctly.
  • context must be a valid pointer.

Methods from Deref<Target = CFType>§

Source

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.

Source

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 IOHIDDevice

Source§

fn as_ref(&self) -> &AnyObject

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<CFType> for IOHIDDevice

Source§

fn as_ref(&self) -> &CFType

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<IOHIDDevice> for IOHIDDevice

Source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Borrow<AnyObject> for IOHIDDevice

Source§

fn borrow(&self) -> &AnyObject

Immutably borrows from an owned value. Read more
Source§

impl Borrow<CFType> for IOHIDDevice

Source§

fn borrow(&self) -> &CFType

Immutably borrows from an owned value. Read more
Source§

impl ConcreteType for IOHIDDevice

Source§

fn type_id() -> CFTypeID

Returns the type identifier of all IOHIDDevice instances.

Source§

impl Debug for IOHIDDevice

Source§

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

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

impl Deref for IOHIDDevice

Source§

type Target = CFType

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl Hash for IOHIDDevice

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Message for IOHIDDevice

Source§

fn retain(&self) -> Retained<Self>
where Self: Sized,

Increment the reference count of the receiver. Read more
Source§

impl PartialEq for IOHIDDevice

Source§

fn eq(&self, other: &Self) -> 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 RefEncode for IOHIDDevice

Source§

const ENCODING_REF: Encoding

The Objective-C type-encoding for a reference of this type. Read more
Source§

impl Type for IOHIDDevice

Source§

fn retain(&self) -> CFRetained<Self>
where Self: Sized,

Increment the reference count of the receiver. Read more
Source§

fn as_concrete_TypeRef(&self) -> &Self

👎Deprecated: this is redundant
Helper for easier transition from the core-foundation crate.
Source§

unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self>
where Self: Sized,

👎Deprecated: use CFRetained::retain
Helper for easier transition from the core-foundation crate. Read more
Source§

fn as_CFTypeRef(&self) -> &CFType
where Self: AsRef<CFType>,

👎Deprecated: this is redundant (CF types deref to CFType)
Helper for easier transition from the core-foundation crate.
Source§

unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self>
where Self: Sized,

👎Deprecated: use CFRetained::from_raw
Helper for easier transition from the core-foundation crate. Read more
Source§

impl Eq for IOHIDDevice

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> 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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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> AutoreleaseSafe for T
where T: ?Sized,