Struct PlatformDirectory

Source
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

Source

pub fn from_path(path: impl AsRef<Path>) -> Result<Self, Error>

Attempt to construct an instance from a filesystem path.

Source

pub fn path(&self) -> &Path

The filesystem path of this instance.

Source

pub fn sdks_path(&self) -> PathBuf

The filesystem path to the directory holding SDKs.

The returned path is not validated to exist.

Source

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>§

Source

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.

Source

pub fn directory_name(&self) -> String

Obtain the directory name of this platform.

This simply appends .platform to Self::filesystem_name().

Source

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

Source§

fn as_ref(&self) -> &Path

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<Platform> for PlatformDirectory

Source§

fn as_ref(&self) -> &Platform

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Deref for PlatformDirectory

Source§

type Target = Platform

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl Ord for PlatformDirectory

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for PlatformDirectory

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for PlatformDirectory

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Eq for PlatformDirectory

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<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.