pub unsafe trait ICDeviceDelegate: NSObjectProtocol {
// Provided methods
unsafe fn device_didCloseSessionWithError(
&self,
device: &ICDevice,
error: Option<&NSError>,
)
where Self: Sized + Message { ... }
unsafe fn didRemoveDevice(&self, device: &ICDevice)
where Self: Sized + Message { ... }
unsafe fn device_didOpenSessionWithError(
&self,
device: &ICDevice,
error: Option<&NSError>,
)
where Self: Sized + Message { ... }
unsafe fn deviceDidBecomeReady(&self, device: &ICDevice)
where Self: Sized + Message { ... }
unsafe fn deviceDidChangeName(&self, device: &ICDevice)
where Self: Sized + Message { ... }
unsafe fn device_didReceiveStatusInformation(
&self,
device: &ICDevice,
status: &NSDictionary<ICDeviceStatus, AnyObject>,
)
where Self: Sized + Message { ... }
unsafe fn device_didEncounterError(
&self,
device: &ICDevice,
error: Option<&NSError>,
)
where Self: Sized + Message { ... }
unsafe fn device_didEjectWithError(
&self,
device: &ICDevice,
error: Option<&NSError>,
)
where Self: Sized + Message { ... }
unsafe fn deviceDidChangeSharingState(&self, device: &ICDevice)
where Self: Sized + Message { ... }
}ICDevice only.Expand description
A delegate of ICDevice must conform to ICDeviceDelegate protocol.
Note: Unless otherwise noted, all delegate callbacks will occur on the main thread.
See also Apple’s documentation
Provided Methods§
Sourceunsafe fn device_didCloseSessionWithError(
&self,
device: &ICDevice,
error: Option<&NSError>,
)
unsafe fn device_didCloseSessionWithError( &self, device: &ICDevice, error: Option<&NSError>, )
This message is sent when a session is closed on a device.
This message completes the process initiated by the message “requestCloseSession” sent to the device object. This message is also sent if the device module in control of the device ceases to control the device.
Note: Execution of the delegate callback will occur on the main thread.
Sourceunsafe fn didRemoveDevice(&self, device: &ICDevice)
unsafe fn didRemoveDevice(&self, device: &ICDevice)
This message is sent to the delegate to inform that a device has been removed.
Sourceunsafe fn device_didOpenSessionWithError(
&self,
device: &ICDevice,
error: Option<&NSError>,
)
unsafe fn device_didOpenSessionWithError( &self, device: &ICDevice, error: Option<&NSError>, )
This message is sent when a session is opened on a device.
This message completes the process initiated by the message “requestOpenSession” sent to the device object.
Note: Execution of the delegate callback will occur on the main thread.
Sourceunsafe fn deviceDidBecomeReady(&self, device: &ICDevice)
unsafe fn deviceDidBecomeReady(&self, device: &ICDevice)
This message is sent when the device is ready to receive requests.
Note: Execution of the delegate callback will occur on the main thread.
Sourceunsafe fn deviceDidChangeName(&self, device: &ICDevice)
unsafe fn deviceDidChangeName(&self, device: &ICDevice)
This message is sent if the name of a device changes.
This happens if the device module overrides the default name of the device reported by the device’s transport layer, or if the name of the filesystem volume mounted by the device is changed by the user.
Note: Execution of the delegate callback will occur on the main thread.
Sourceunsafe fn device_didReceiveStatusInformation(
&self,
device: &ICDevice,
status: &NSDictionary<ICDeviceStatus, AnyObject>,
)
unsafe fn device_didReceiveStatusInformation( &self, device: &ICDevice, status: &NSDictionary<ICDeviceStatus, AnyObject>, )
This message is sent to the device delegate when status information is received from a device.
The ‘status’ dictionary contains two keys, ICStatusNotificationKey and ICLocalizedStatusNotificationKey, which are defined above. Status information keys are located in their respective ICDevice type class header.
Note: Execution of the delegate callback will occur on the main thread.
§Safety
status generic should be of the correct type.
Sourceunsafe fn device_didEncounterError(
&self,
device: &ICDevice,
error: Option<&NSError>,
)
unsafe fn device_didEncounterError( &self, device: &ICDevice, error: Option<&NSError>, )
This message is sent to the device delegate a device encounters an error.
Note: Execution of the delegate callback will occur on the main thread.
Sourceunsafe fn device_didEjectWithError(
&self,
device: &ICDevice,
error: Option<&NSError>,
)
unsafe fn device_didEjectWithError( &self, device: &ICDevice, error: Option<&NSError>, )
This message is sent to the device delegate when the eject has completed.
Note: Execution of the delegate callback will occur on the main thread.
Sourceunsafe fn deviceDidChangeSharingState(&self, device: &ICDevice)
👎Deprecated: Device sharing is no longer available
unsafe fn deviceDidChangeSharingState(&self, device: &ICDevice)
This message is sent when the sharing state of a device has changes.
Any Image Capture client application can choose to share the device over the network using the sharing or webSharing facility in Image Capture.
Note: Execution of the delegate callback will occur on the main thread.