pub struct PlatformDirectory { /* private fields */ }
Expand description
Represents an Apple Platform directory.
This is just a thin abstraction over a filesystem path and a Platform instance.
Equivalence and sorting are implemented in terms of the path component only. The assumption here is the Platform is fully derived from the filesystem path and this derivation is deterministic.
Implementations§
Source§impl PlatformDirectory
impl PlatformDirectory
Sourcepub fn from_path(path: impl AsRef<Path>) -> Result<Self, Error>
pub fn from_path(path: impl AsRef<Path>) -> Result<Self, Error>
Attempt to construct an instance from a filesystem path.
Sourcepub fn sdks_path(&self) -> PathBuf
pub fn sdks_path(&self) -> PathBuf
The filesystem path to the directory holding SDKs.
The returned path is not validated to exist.
Sourcepub fn find_sdks<T: AppleSdk>(&self) -> Result<Vec<T>, Error>
pub fn find_sdks<T: AppleSdk>(&self) -> Result<Vec<T>, Error>
Finds SDKs in this platform directory.
The type of SDK to resolve must be specified by the caller.
This function is a simple wrapper around AppleSdk::find_in_directory() looking
under the Developer/SDKs
directory, which is where SDKs are located in platform
directories.
Methods from Deref<Target = Platform>§
Sourcepub fn filesystem_name(&self) -> &str
pub fn filesystem_name(&self) -> &str
Obtain the name of this platform as used in filesystem paths.
This is just the platform part of the name without the trailing
.platform
. This string appears in the *.platform
directory names
as well as in SDK directory names preceding the trailing .sdk
and
optional SDK version.
Sourcepub fn directory_name(&self) -> String
pub fn directory_name(&self) -> String
Obtain the directory name of this platform.
This simply appends .platform
to Self::filesystem_name().
Sourcepub fn path_in_developer_directory(
&self,
developer_directory: impl AsRef<Path>,
) -> PathBuf
pub fn path_in_developer_directory( &self, developer_directory: impl AsRef<Path>, ) -> PathBuf
Obtain the path of this platform relative to a developer directory root.
Trait Implementations§
Source§impl AsRef<Path> for PlatformDirectory
impl AsRef<Path> for PlatformDirectory
Source§impl AsRef<Platform> for PlatformDirectory
impl AsRef<Platform> for PlatformDirectory
Source§impl Deref for PlatformDirectory
impl Deref for PlatformDirectory
Source§impl Ord for PlatformDirectory
impl Ord for PlatformDirectory
Source§impl PartialEq for PlatformDirectory
impl PartialEq for PlatformDirectory
Source§impl PartialOrd for PlatformDirectory
impl PartialOrd for PlatformDirectory
impl Eq for PlatformDirectory
Auto Trait Implementations§
impl Freeze for PlatformDirectory
impl RefUnwindSafe for PlatformDirectory
impl Send for PlatformDirectory
impl Sync for PlatformDirectory
impl Unpin for PlatformDirectory
impl UnwindSafe for PlatformDirectory
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.