pub struct SupportedTarget {
    pub archs: Vec<String>,
    pub default_deployment_target: String,
    pub default_variant: Option<String>,
    pub deployment_target_setting_name: Option<String>,
    pub minimum_deployment_target: String,
    pub platform_family_name: Option<String>,
    pub valid_deployment_targets: Vec<String>,
}
Expand description

Represents a SupportedTargets value in a SDKSettings.json file.

Fields§

§archs: Vec<String>

Names of machine architectures that can be targeted.

e.g. x86_64, arm64, arm64e.

§default_deployment_target: String

Default deployment target version.

Likely corresponds to the OS version this SDK is associated with. e.g. the macOS 12.3 SDK would target 12.3 by default.

§default_variant: Option<String>

The name of the settings variant to use by default.

§deployment_target_setting_name: Option<String>

The name of the toolchain setting that influences which deployment target version is used.

e.g. on macOS this will be MACOSX_DEPLOYMENT_TARGET. This represents an environment variable that can be set to influence which deployment target version to use.

§minimum_deployment_target: String

The lowest version of a platform that this SDK can target.

Using this SDK, it is possible to emit code that will support running down to the OS version specified by this value. e.g. 10.9 is a common value for macOS SDKs.

§platform_family_name: Option<String>

A name given to the platform.

e.g. macOS.

§valid_deployment_targets: Vec<String>

List of platform versions that this SDK can target.

This is likely a range of all major versions between minimum_deployment_target and default_deployment_target.

Implementations§

Obtain SdkVersion for each deployment target this target supports.

Examples found in repository?
src/parsed_sdk.rs (line 218)
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
    fn supports_deployment_target(
        &self,
        target_name: &str,
        target_version: &SdkVersion,
    ) -> Result<bool, Error> {
        Ok(
            if let Some(target) = self.supported_targets.get(target_name) {
                target
                    .deployment_targets_versions()
                    .contains(target_version)
            } else {
                false
            },
        )
    }

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.