ILMessageFilterQueryHandling

Trait ILMessageFilterQueryHandling 

Source
pub unsafe trait ILMessageFilterQueryHandling: NSObjectProtocol {
    // Provided method
    unsafe fn handleQueryRequest_context_completion(
        &self,
        query_request: &ILMessageFilterQueryRequest,
        context: &ILMessageFilterExtensionContext,
        completion: &DynBlock<dyn Fn(NonNull<ILMessageFilterQueryResponse>)>,
    )
       where Self: Sized + Message { ... }
}
Available on crate feature ILMessageFilterQueryHandling only.
Expand description

Functionality related to MessageFilter extension query requests.

Subclasses of ILMessageFilterExtension which support querying must conform to this protocol.

See also Apple’s documentation

Provided Methods§

Source

unsafe fn handleQueryRequest_context_completion( &self, query_request: &ILMessageFilterQueryRequest, context: &ILMessageFilterExtensionContext, completion: &DynBlock<dyn Fn(NonNull<ILMessageFilterQueryResponse>)>, )
where Self: Sized + Message,

Available on crate features ILMessageFilterExtensionContext and ILMessageFilterQueryRequest and ILMessageFilterQueryResponse and block2 only.

Evaluate a query request and provide a response describing how the system should handle the message it represents.

May include either (or both) of the following:

  • Using offline/stored information to form a response about the message described by the query request.

  • Deferring the query request to a network service associated with the app extension, allowing the network service to return data back to extension in order to form a response about the message. The context parameter provides an API which allows deferring a request to the network and receiving the response to that network request.

Block specified in completion parameter must be invoked with a response describing how to handle the message, and may be invoked asynchronously.

Parameter queryRequest: A query request to be handled which describes a received message.

Parameter context: Extension context which offers API to defer request to network if necessary.

Parameter completion: Completion block for returning a response.

Trait Implementations§

Source§

impl ProtocolType for dyn ILMessageFilterQueryHandling

Source§

const NAME: &'static str = "ILMessageFilterQueryHandling"

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 ILMessageFilterQueryHandling

Implementations on Foreign Types§

Source§

impl<T> ILMessageFilterQueryHandling for ProtocolObject<T>

Implementors§