Trait AppleSdk

Source
pub trait AppleSdk: Sized + AsRef<Path> {
    // Required methods
    fn from_directory(path: &Path) -> Result<Self, Error>;
    fn is_symlink(&self) -> bool;
    fn platform(&self) -> &Platform;
    fn version(&self) -> Option<&SdkVersion>;
    fn supports_deployment_target(
        &self,
        target_name: &str,
        target_version: &SdkVersion,
    ) -> Result<bool, Error>;

    // Provided methods
    fn find_in_directory(root: &Path) -> Result<Vec<Self>, Error> { ... }
    fn find_command_line_tools_sdks() -> Result<Option<Vec<Self>>, Error> { ... }
    fn sdk_path(&self) -> SdkPath { ... }
    fn as_sdk_path(&self) -> SdkPath { ... }
    fn path(&self) -> &Path { ... }
}
Expand description

Defines common behavior for types representing Apple SDKs.

Required Methods§

Source

fn from_directory(path: &Path) -> Result<Self, Error>

Attempt to construct an instance from a filesystem directory.

Implementations will likely error with Error::PathNotSdk or Error::Io if the input path is not an Apple SDK.

Whether this SDK path is a symlink.

Source

fn platform(&self) -> &Platform

The platform this SDK is for.

Source

fn version(&self) -> Option<&SdkVersion>

Obtain the version string for this SDK.

This should always be Some for ParsedSdk. It can be None if SDK metadata is not loaded and the version string isn’t available from side-channels such as the directory name.

Source

fn supports_deployment_target( &self, target_name: &str, target_version: &SdkVersion, ) -> Result<bool, Error>

Whether this SDK supports targeting the given target name at specified OS version.

Provided Methods§

Source

fn find_in_directory(root: &Path) -> Result<Vec<Self>, Error>

Find Apple SDKs in a specified directory.

Directory entries are often symlinks pointing to other directories. SDKs are annotated with an is_symlink field to denote when this is the case. Callers may want to filter out symlinked SDKs to avoid duplicates.

Source

fn find_command_line_tools_sdks() -> Result<Option<Vec<Self>>, Error>

Locate SDKs installed as part of the Xcode Command Line Tools.

This is a convenience method for looking for SDKs in the SDKs directory under the default install path for the Xcode Command Line Tools.

Returns Ok(None) if the Xcode Command Line Tools are not present in this directory or doesn’t have an SDKs directory.

Source

fn sdk_path(&self) -> SdkPath

Obtain an SdkPath represent this SDK.

Source

fn as_sdk_path(&self) -> SdkPath

👎Deprecated since 0.1.1: plase use sdk_path instead
Source

fn path(&self) -> &Path

Obtain the filesystem path to this SDK.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§