MacOsConfig

Struct MacOsConfig 

Source
#[non_exhaustive]
pub struct MacOsConfig {
Show 13 fields pub frameworks: Option<Vec<String>>, pub minimum_system_version: Option<String>, pub exception_domain: Option<String>, pub signing_identity: Option<String>, pub signing_certificate: Option<OsString>, pub signing_certificate_password: Option<OsString>, pub notarization_credentials: Option<MacOsNotarizationCredentials>, pub provider_short_name: Option<String>, pub entitlements: Option<String>, pub info_plist_path: Option<PathBuf>, pub embedded_provisionprofile_path: Option<PathBuf>, pub embedded_apps: Option<Vec<String>>, pub background_app: bool,
}
Expand description

The macOS configuration.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§frameworks: Option<Vec<String>>

MacOS frameworks that need to be packaged with the app.

Each string can either be the name of a framework (without the .framework extension, e.g. "SDL2"), in which case we will search for that framework in the standard install locations (~/Library/Frameworks/, /Library/Frameworks/, and /Network/Library/Frameworks/), or a path to a specific framework bundle (e.g. ./data/frameworks/SDL2.framework). Note that this setting just makes cargo-packager copy the specified frameworks into the OS X app bundle (under Foobar.app/Contents/Frameworks/); you are still responsible for:

  • arranging for the compiled binary to link against those frameworks (e.g. by emitting lines like cargo:rustc-link-lib=framework=SDL2 from your build.rs script)

  • embedding the correct rpath in your binary (e.g. by running install_name_tool -add_rpath "@executable_path/../Frameworks" path/to/binary after compiling)

§minimum_system_version: Option<String>

A version string indicating the minimum MacOS version that the packaged app supports (e.g. "10.11"). If you are using this config field, you may also want have your build.rs script emit cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET=10.11.

§exception_domain: Option<String>

The exception domain to use on the macOS .app package.

This allows communication to the outside world e.g. a web server you’re shipping.

§signing_identity: Option<String>

Code signing identity.

This is typically of the form: "Developer ID Application: TEAM_NAME (TEAM_ID)".

§signing_certificate: Option<OsString>

Codesign certificate (base64 encoded of the p12 file).

Note: this field cannot be specified via a config file or Cargo package metadata.

§signing_certificate_password: Option<OsString>

Password of the codesign certificate.

Note: this field cannot be specified via a config file or Cargo package metadata.

§notarization_credentials: Option<MacOsNotarizationCredentials>

Notarization authentication credentials.

Note: this field cannot be specified via a config file or Cargo package metadata.

§provider_short_name: Option<String>

Provider short name for notarization.

§entitlements: Option<String>

Path to the entitlements.plist file.

§info_plist_path: Option<PathBuf>

Path to the Info.plist file for the package.

§embedded_provisionprofile_path: Option<PathBuf>

Path to the embedded.provisionprofile file for the package.

§embedded_apps: Option<Vec<String>>

Apps that need to be packaged within the app.

§background_app: bool

Whether this is a background application. If true, the app will not appear in the Dock.

Sets the LSUIElement flag in the macOS plist file.

Implementations§

Source§

impl MacOsConfig

Source

pub fn new() -> Self

Creates a new MacOsConfig.

Source

pub fn frameworks<I, S>(self, frameworks: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

MacOS frameworks that need to be packaged with the app.

Each string can either be the name of a framework (without the .framework extension, e.g. "SDL2"), in which case we will search for that framework in the standard install locations (~/Library/Frameworks/, /Library/Frameworks/, and /Network/Library/Frameworks/), or a path to a specific framework bundle (e.g. ./data/frameworks/SDL2.framework). Note that this setting just makes cargo-packager copy the specified frameworks into the OS X app bundle (under Foobar.app/Contents/Frameworks/); you are still responsible for:

  • arranging for the compiled binary to link against those frameworks (e.g. by emitting lines like cargo:rustc-link-lib=framework=SDL2 from your build.rs script)

  • embedding the correct rpath in your binary (e.g. by running install_name_tool -add_rpath "@executable_path/../Frameworks" path/to/binary after compiling)

Source

pub fn minimum_system_version<S: Into<String>>( self, minimum_system_version: S, ) -> Self

A version string indicating the minimum MacOS version that the packaged app supports (e.g. "10.11"). If you are using this config field, you may also want have your build.rs script emit cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET=10.11.

Source

pub fn exception_domain<S: Into<String>>(self, exception_domain: S) -> Self

The exception domain to use on the macOS .app package.

This allows communication to the outside world e.g. a web server you’re shipping.

Source

pub fn signing_identity<S: Into<String>>(self, signing_identity: S) -> Self

Code signing identity.

Source

pub fn provider_short_name<S: Into<String>>( self, provider_short_name: S, ) -> Self

Provider short name for notarization.

Source

pub fn entitlements<S: Into<String>>(self, entitlements: S) -> Self

Path to the entitlements.plist file.

Source

pub fn info_plist_path<S: Into<PathBuf>>(self, info_plist_path: S) -> Self

Path to the Info.plist file for the package.

Source

pub fn embedded_provisionprofile_path<S: Into<PathBuf>>( self, embedded_provisionprofile_path: S, ) -> Self

Path to the embedded.provisionprofile file for the package.

Source

pub fn embedded_apps<I, S>(self, embedded_apps: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

Apps that need to be packaged within the app.

Trait Implementations§

Source§

impl Clone for MacOsConfig

Source§

fn clone(&self) -> MacOsConfig

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 MacOsConfig

Source§

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

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

impl Default for MacOsConfig

Source§

fn default() -> MacOsConfig

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

impl<'de> Deserialize<'de> for MacOsConfig

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 Serialize for MacOsConfig

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

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

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