NSFileProviderExternalVolumeHandling

Trait NSFileProviderExternalVolumeHandling 

Source
pub unsafe trait NSFileProviderExternalVolumeHandling: NSObjectProtocol {
    // Provided method
    unsafe fn shouldConnectExternalDomainWithCompletionHandler(
        &self,
        completion_handler: &DynBlock<dyn Fn(*mut NSError)>,
    )
       where Self: Sized + Message { ... }
}
Available on crate feature NSFileProviderReplicatedExtension only.
Expand description

Provided Methods§

Source

unsafe fn shouldConnectExternalDomainWithCompletionHandler( &self, completion_handler: &DynBlock<dyn Fn(*mut NSError)>, )
where Self: Sized + Message,

Available on crate feature block2 only.

Implement this protocol on your extension’s Principal Class in order for the system to ask your extension whether a domain located on an external volume should be connected.

Your extension may use this method as an opportunity to check for, and setup if necessary, state to operate the extension. Such as prompting the user to login in your application. When creating domains on external drive, store state related to the domain in the userInfo parameter to -[NSFileProviderDomain initWithDisplayName:userInfo:volumeURL:], such as the user’s ID, to help your extension identify the domain when connected on other devices. This userInfo will be persisted on the external volume, and provided in the ReplicatedExtension initializer when the drive is connected to a new device.

If your extension responds with an NSError, the domain will be in a disconnected state. Non-downloaded files in the domain will not be downloadable, and file edits will not be synced up. The system will display UI to inform the user. Your extension will be able to enumerate this domain in +[NSFileProviderManager getDomainsWithCompletionHandler:], with the -[NSFileProviderDomain disconnected] property set as YES.

If at a later point, the user has setup the necessary state to service requests for the disconnected external domain, your extension may call -[NSFileProviderManager reconnectWithCompletionHandler:].

If your extension does not implement this protocol, domains on external volumes will automatically be connected and instantiated in your extension.

Trait Implementations§

Source§

impl ProtocolType for dyn NSFileProviderExternalVolumeHandling

Source§

const NAME: &'static str = "NSFileProviderExternalVolumeHandling"

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 NSFileProviderExternalVolumeHandling

Implementations on Foreign Types§

Source§

impl<T> NSFileProviderExternalVolumeHandling for ProtocolObject<T>

Implementors§