Trait OSSystemExtensionRequestDelegate

Source
pub unsafe trait OSSystemExtensionRequestDelegate: NSObjectProtocol {
    // Provided methods
    unsafe fn request_actionForReplacingExtension_withExtension(
        &self,
        request: &OSSystemExtensionRequest,
        existing: &OSSystemExtensionProperties,
        ext: &OSSystemExtensionProperties,
    ) -> OSSystemExtensionReplacementAction
       where Self: Sized + Message { ... }
    unsafe fn requestNeedsUserApproval(
        &self,
        request: &OSSystemExtensionRequest,
    )
       where Self: Sized + Message { ... }
    unsafe fn request_didFinishWithResult(
        &self,
        request: &OSSystemExtensionRequest,
        result: OSSystemExtensionRequestResult,
    )
       where Self: Sized + Message { ... }
    unsafe fn request_didFailWithError(
        &self,
        request: &OSSystemExtensionRequest,
        error: &NSError,
    )
       where Self: Sized + Message { ... }
    unsafe fn request_foundProperties(
        &self,
        request: &OSSystemExtensionRequest,
        properties: &NSArray<OSSystemExtensionProperties>,
    )
       where Self: Sized + Message { ... }
}
Expand description

Provided Methods§

Source

unsafe fn request_actionForReplacingExtension_withExtension( &self, request: &OSSystemExtensionRequest, existing: &OSSystemExtensionProperties, ext: &OSSystemExtensionProperties, ) -> OSSystemExtensionReplacementAction
where Self: Sized + Message,

Called when the target extension bundle identifier is already activated.

The delegate will receive this callback when an activation request encounters an existing extension with the same team and bundle identifiers but with different version identifiers. The delegate must make a decision on whether or not to replace the existing extension.

Parameter request: The request that encountered the conflict

Parameter existing: The NSBundle of the existing extension

Parameter ext: The NSBundle of the extension matching the bundle identifier of the request

Returns: A replacement action indicating the desired outcome of the conflict

Note: This method is invoked if the CFBundleVersion or CFBundleShortVersionString identifiers of the target and existing extension differ.

If the local system has System Extension developer mode enabled, this callback will always fire when an existing extension is found, regardless of version identifiers.

Returning OSSystemExtensionReplacementActionAbortRequest will trigger a callback to request:didFailWithError: with the OSSystemExtensionErrorRequestCanceled error code.

Source

unsafe fn requestNeedsUserApproval(&self, request: &OSSystemExtensionRequest)
where Self: Sized + Message,

Called when the target extension requires user approval to be activated.

Activating an extension may require explicit user approval in order to proceed. For example, this can occur when the user has never previously approved this extension. If approval is necessary, this callback will be triggered and the activation request will remain pending until user approves, or until the application exits.

Source

unsafe fn request_didFinishWithResult( &self, request: &OSSystemExtensionRequest, result: OSSystemExtensionRequestResult, )
where Self: Sized + Message,

Called when the target extension request has completed.

Successful results can come with additional information regarding the manner in which they were completed. See the OSSystemExtensionRequestResult documentation for more information.

Parameter result: Additional result information from the completed request.

Note: If the request completes with the OSSystemExtensionRequestWillCompleteAfterReboot result, then the extension will not be active until after the next reboot. Upon reboot, a given extension will be in the state dictated by the most recently processed request.

Source

unsafe fn request_didFailWithError( &self, request: &OSSystemExtensionRequest, error: &NSError, )
where Self: Sized + Message,

Called when the target extension request failed.

Source

unsafe fn request_foundProperties( &self, request: &OSSystemExtensionRequest, properties: &NSArray<OSSystemExtensionProperties>, )
where Self: Sized + Message,

Called request for properties has completed.

Parameter properties: Returns an array of OSSystemExtensionProperties matching the requested bundle identifier.

Trait Implementations§

Source§

impl ProtocolType for dyn OSSystemExtensionRequestDelegate

Source§

const NAME: &'static str = "OSSystemExtensionRequestDelegate"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn OSSystemExtensionRequestDelegate

Implementations on Foreign Types§

Source§

impl<T> OSSystemExtensionRequestDelegate for ProtocolObject<T>

Implementors§