objc2_identity_lookup/generated/
ILMessageFilterQueryHandling.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9extern_protocol!(
10    /// Functionality related to MessageFilter extension query requests.
11    ///
12    /// Subclasses of ILMessageFilterExtension which support querying must conform to this protocol.
13    ///
14    /// See also [Apple's documentation](https://developer.apple.com/documentation/identitylookup/ilmessagefilterqueryhandling?language=objc)
15    pub unsafe trait ILMessageFilterQueryHandling: NSObjectProtocol {
16        #[cfg(all(
17            feature = "ILMessageFilterExtensionContext",
18            feature = "ILMessageFilterQueryRequest",
19            feature = "ILMessageFilterQueryResponse",
20            feature = "block2"
21        ))]
22        /// Evaluate a query request and provide a response describing how the system should handle the message it represents.
23        ///
24        /// May include either (or both) of the following:
25        ///
26        /// - Using offline/stored information to form a response about the message described by the query request.
27        ///
28        /// - Deferring the query request to a network service associated with the app extension, allowing the network service to
29        /// return data back to extension in order to form a response about the message. The `context` parameter provides an API which
30        /// allows deferring a request to the network and receiving the response to that network request.
31        ///
32        /// Block specified in `completion` parameter must be invoked with a response describing how to handle the message, and may be
33        /// invoked asynchronously.
34        ///
35        ///
36        /// Parameter `queryRequest`: A query request to be handled which describes a received message.
37        ///
38        /// Parameter `context`: Extension context which offers API to defer request to network if necessary.
39        ///
40        /// Parameter `completion`: Completion block for returning a response.
41        #[unsafe(method(handleQueryRequest:context:completion:))]
42        #[unsafe(method_family = none)]
43        unsafe fn handleQueryRequest_context_completion(
44            &self,
45            query_request: &ILMessageFilterQueryRequest,
46            context: &ILMessageFilterExtensionContext,
47            completion: &block2::DynBlock<dyn Fn(NonNull<ILMessageFilterQueryResponse>)>,
48        );
49    }
50);