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§
Sourcefn from_directory(path: &Path) -> Result<Self, Error>
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.
Sourcefn is_symlink(&self) -> bool
fn is_symlink(&self) -> bool
Whether this SDK path is a symlink.
Sourcefn version(&self) -> Option<&SdkVersion>
fn version(&self) -> Option<&SdkVersion>
Sourcefn supports_deployment_target(
&self,
target_name: &str,
target_version: &SdkVersion,
) -> Result<bool, Error>
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§
Sourcefn find_in_directory(root: &Path) -> Result<Vec<Self>, Error>
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.
Sourcefn find_command_line_tools_sdks() -> Result<Option<Vec<Self>>, Error>
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.
fn as_sdk_path(&self) -> SdkPath
sdk_path insteadDyn 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.