FilesAndFolders

Struct FilesAndFolders 

Source
pub struct FilesAndFolders {
    pub desktop_folder_usage_description: Option<String>,
    pub documents_folder_usage_description: Option<String>,
    pub downloads_folder_usage_description: Option<String>,
    pub network_volumes_usage_description: Option<String>,
    pub removable_volumes_usage_description: Option<String>,
    pub file_provider_presence_usage_description: Option<String>,
    pub file_provider_domain_usage_description: Option<String>,
}
Expand description

Files and Folders

Fields§

§desktop_folder_usage_description: Option<String>

A message that tells the user why the app needs access to the user’s Desktop folder.

The user implicitly grants your app access to a file in the Desktop folder when selecting the file in an Open or Save panel, dragging it onto your app, or opening it in Finder. Your app can access that file right away and any time in the future. In addition, if your app creates a new file in the Desktop folder, the app can access that file without user consent.

The first time your app tries to access a file in the user’s Desktop folder without implied user consent, the system prompts the user for permission to access the folder’s contents. Add the NSDesktopFolderUsageDescription key to your app’s Information Property List file to provide a message that explains why your app needs access. The usage description is optional, but highly recommended.

App Sandbox enforces stricter limits on Desktop folder access, so that policy may supersede this one if your app enables sandboxing. See App Sandbox for more information.

After the user chooses whether to grant access, the system remembers the user’s choice. To reset permissions, use the tccutil command line utility with your app’s bundle ID:

$ tccutil reset SystemPolicyDesktopFolder <bundleID>

§Availability

  • macOS 10.15+

§Framework

  • Foundation
§documents_folder_usage_description: Option<String>

A message that tells the user why the app needs access to the user’s Documents folder.

The user implicitly grants your app access to a file in the Documents folder when selecting the file in an Open or Save panel, dragging it onto your app, or opening it in Finder. Your app can access that file right away and any time in the future. In addition, if your app creates a new file in the Documents folder, the app can access that file without user consent.

The first time your app tries to access a file in the user’s Documents folder without implied user consent, the system prompts the user for permission to access the folder’s contents. Add the NSDocumentsFolderUsageDescription key to your app’s Information Property List file to provide a message that explains why your app needs access. The usage description is optional, but highly recommended.

App Sandbox enforces stricter limits on Documents folder access, so that policy may supersede this one if your app enables sandboxing. See App Sandbox for more information.

After the user chooses whether to grant access, the system remembers the user’s choice. To reset permissions, use the tccutil command line utility with your app’s bundle ID:

$ tccutil reset SystemPolicyDocumentsFolder <bundleID>

§Availability

  • macOS 10.15+

§Framework

  • Foundation
§downloads_folder_usage_description: Option<String>

A message that tells the user why the app needs access to the user’s Documents folder.

The user implicitly grants your app access to a file in the Documents folder when selecting the file in an Open or Save panel, dragging it onto your app, or opening it in Finder. Your app can access that file right away and any time in the future. In addition, if your app creates a new file in the Documents folder, the app can access that file without user consent.

The first time your app tries to access a file in the user’s Documents folder without implied user consent, the system prompts the user for permission to access the folder’s contents. Add the NSDocumentsFolderUsageDescription key to your app’s Information Property List file to provide a message that explains why your app needs access. The usage description is optional, but highly recommended.

App Sandbox enforces stricter limits on Documents folder access, so that policy may supersede this one if your app enables sandboxing. See App Sandbox for more information.

After the user chooses whether to grant access, the system remembers the user’s choice. To reset permissions, use the tccutil command line utility with your app’s bundle ID:

$ tccutil reset SystemPolicyDownloadsFolder <bundleID>

§Availability

  • macOS 10.15+

§Framework

  • Foundation
§network_volumes_usage_description: Option<String>

A message that tells the user why the app needs access to files on a network volume.

The user implicitly grants your app access to a file on a network volume when selecting the file in an Open or Save panel, dragging it onto your app, or opening it in Finder. Your app can access that file right away and any time in the future. In addition, if your app creates a new file on a network volume, the app can access that file without user consent.

The first time your app tries to access a file on a network volume without implied user consent, the system prompts the user for permission to access network volumes. Add the NSNetworkVolumesUsageDescription key to your app’s Information Property List file to provide a string for the prompt that explains why your app needs access. The usage description is optional, but highly recommended.

After the user chooses whether to grant access, the system remembers the user’s choice. To reset permissions, use the tccutil command line utility with your app’s bundle ID:

$ tccutil reset SystemPolicyNetworkVolumes <bundleID>

§Availability

  • macOS 10.15+

§Framework

  • Foundation
§removable_volumes_usage_description: Option<String>

A message that tells the user why the app needs access to files on a removable volume.

The user implicitly grants your app access to a file on a removable volume—like a USB thumb drive—when selecting the file in an Open or Save panel, dragging it onto your app, or opening it in Finder. Your app can access that file right away and any time in the future. In addition, if your app creates a new file on a removable volume, the app can access that file without user consent.

The first time your app tries to access a file on a removable volume without implied user consent, the system prompts the user for permission to access removable volumes. Add the NSRemovableVolumesUsageDescription key to your app’s Information Property List file to provide a string for the prompt that explains why your app needs access. The usage description is optional, but highly recommended.

After the user chooses whether to grant access, the system remembers the user’s choice. To reset permissions, use the tccutil command line utility with your app’s bundle ID:

$ tccutil reset SystemPolicyRemovableVolumes <bundleID>

§Availability

  • macOS 10.15+

§Framework

  • Foundation
§file_provider_presence_usage_description: Option<String>

A message that tells the user why the app needs to be informed when other apps access files that it manages

An app that adopts the File Provider framework can see when and with which other apps the user accesses managed files. Before providing this kind of information to a file provider, the system prompts the user to grant access. Add the NSFileProviderPresenceUsageDescription key to your file provider app’s Information Property List file to provide a string for the prompt that explains why your app needs this information.

After the user chooses whether to grant access, the system remembers the user’s choice. To reset permissions, use the tccutil command line utility with your app’s bundle ID:

$ tccutil reset FileProviderPresence <bundleID>

§Availability

  • macOS 10.15+

§Framework

  • Foundation
§file_provider_domain_usage_description: Option<String>

A message that tells the user why the app needs access to files managed by a file provider.

The user implicitly grants your app access to a file managed by a file provider when selecting the file in an Open or Save panel, dragging it onto your app, or opening it in Finder. Your app can access that file right away and any time in the future. In addition, if your app creates a new file managed by a file provider, the app can access that file without user consent.

The first time your app tries to access a file managed by a file provider without implied user consent, the system prompts the user for permission. Add the NSFileProviderDomainUsageDescription key to your app’s Information Property List file to provide a string for the prompt that explains why your app needs access. The usage description is optional, but highly recommended.

After the user chooses whether to grant access, the system remembers the user’s choice. To reset permissions, use the tccutil command line utility with your app’s bundle ID:

$ tccutil reset FileProviderDomain <bundleID>

§Availability

  • macOS 10.15+

§Framework

  • Foundation

Trait Implementations§

Source§

impl Clone for FilesAndFolders

Source§

fn clone(&self) -> FilesAndFolders

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FilesAndFolders

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for FilesAndFolders

Source§

fn default() -> FilesAndFolders

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for FilesAndFolders

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for FilesAndFolders

Source§

fn eq(&self, other: &FilesAndFolders) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for FilesAndFolders

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for FilesAndFolders

Source§

impl StructuralPartialEq for FilesAndFolders

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,