MEMessageEncoder

Trait MEMessageEncoder 

Source
pub unsafe trait MEMessageEncoder: NSObjectProtocol {
    // Provided methods
    unsafe fn getEncodingStatusForMessage_composeContext_completionHandler(
        &self,
        message: &MEMessage,
        compose_context: &MEComposeContext,
        completion_handler: &DynBlock<dyn Fn(NonNull<MEOutgoingMessageEncodingStatus>)>,
    )
       where Self: Sized + Message { ... }
    unsafe fn encodeMessage_composeContext_completionHandler(
        &self,
        message: &MEMessage,
        compose_context: &MEComposeContext,
        completion_handler: &DynBlock<dyn Fn(NonNull<MEMessageEncodingResult>)>,
    )
       where Self: Sized + Message { ... }
}
Available on crate feature MEMessageEncoder only.
Expand description

Methods in this protocol can be used by a mail app extension to encode messages.

See also Apple’s documentation

Provided Methods§

Source

unsafe fn getEncodingStatusForMessage_composeContext_completionHandler( &self, message: &MEMessage, compose_context: &MEComposeContext, completion_handler: &DynBlock<dyn Fn(NonNull<MEOutgoingMessageEncodingStatus>)>, )
where Self: Sized + Message,

Available on crate features MEComposeContext and MEMessage and MEOutgoingMessageEncodingStatus and block2 only.

This is invoked while a message is being composed. This will be be invoked each time the sending address or the list of recipients changes. The supplied messagewill contain the email address of the sender, the recipient email addresses, and the message data being sent. The completion handler should be called with the current encoding status of the message indicating whether the message is able to be signed, encrypted, both or neither. The result will also contain any error that occured, including a list of any recipients whose encryption keys are expected and missing.

Parameter message: - The outgoing message to apply any security mechanisms on.

Parameter composeContext: - MEComposeContextinstance which corresponds to the messagebeing composed.

Source

unsafe fn encodeMessage_composeContext_completionHandler( &self, message: &MEMessage, compose_context: &MEComposeContext, completion_handler: &DynBlock<dyn Fn(NonNull<MEMessageEncodingResult>)>, )
where Self: Sized + Message,

Available on crate features MEComposeContext and MEMessage and MEMessageEncodingResult and block2 only.

This is invoked when an outgoing message is sent. The supplied messagewill contain the email address of the sender, the recipient email addresses, and the message data being sent. The completion handler should be called with the resultof applying any encoding if needed based on shouldSignand shouldEncrypt.If the resultis not encrypted or signed and does not have any errors, it is assumed the message did not need a signature or encryption applied. In this case the datafor the result will be ignored.

Parameter message: - The outgoing message to apply any security mechanisms on.

Parameter composeContext: - MEComposeContextinstance which corresponds to the messagebeing composed.

Trait Implementations§

Source§

impl ProtocolType for dyn MEMessageEncoder

Source§

const NAME: &'static str = "MEMessageEncoder"

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 MEMessageEncoder

Implementations on Foreign Types§

Source§

impl<T> MEMessageEncoder for ProtocolObject<T>
where T: ?Sized + MEMessageEncoder,

Implementors§