MEMessageActionHandler

Trait MEMessageActionHandler 

Source
pub unsafe trait MEMessageActionHandler: NSObjectProtocol {
    // Provided methods
    unsafe fn decideActionForMessage_completionHandler(
        &self,
        message: &MEMessage,
        completion_handler: &DynBlock<dyn Fn(*mut MEMessageActionDecision)>,
    )
       where Self: Sized + Message { ... }
    unsafe fn requiredHeaders(&self) -> Retained<NSArray<NSString>>
       where Self: Sized + Message { ... }
}
Available on crate feature MEMessageActionHandler only.
Expand description

Methods in this protocol can be used by a mail app extension to perform actions on messages as they are downloaded.

See also Apple’s documentation

Provided Methods§

Source

unsafe fn decideActionForMessage_completionHandler( &self, message: &MEMessage, completion_handler: &DynBlock<dyn Fn(*mut MEMessageActionDecision)>, )
where Self: Sized + Message,

Available on crate features MEMessage and MEMessageActionDecision and block2 only.

This is invoked when a message is downloaded. The action set in the completion handler will be performed on the message. Depending on if the full body of the message has been downloaded the MEMessageprovided might have the full body data. If the full body is not present the decisionproperty can be set to MEMessageActionDecision.invokeAgainWithBodyand this method will be invoked again once the full body is available.

Parameter message: - The message for which the action will be performed. Might or might not contain the full message body data.

Source

unsafe fn requiredHeaders(&self) -> Retained<NSArray<NSString>>
where Self: Sized + Message,

Provide additional headers that the extension requires to perform an action. Mail will fetch these additional headers before invoking -[MEMessageActionHandler``decideActionForMessage:completionHandler:].For example, extensions can return the headers that were set in -[MEComposeSessionHandler``additionalHeadersForSession:] Returns: An array of header keys. Mail will normalize the headers to lower case before fetching them from the mail server.

Trait Implementations§

Source§

impl ProtocolType for dyn MEMessageActionHandler

Source§

const NAME: &'static str = "MEMessageActionHandler"

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 MEMessageActionHandler

Implementations on Foreign Types§

Source§

impl<T> MEMessageActionHandler for ProtocolObject<T>

Implementors§