pub enum Platform {
AppleTvOs,
AppleTvSimulator,
DriverKit,
IPhoneOs,
IPhoneSimulator,
MacOsX,
WatchOs,
WatchSimulator,
XrOs,
XrOsSimulator,
Unknown(String),
}
Expand description
A known Apple platform type.
Instances are equivalent to each other if their filesystem representation is equivalent. This ensures that Self::Unknown will equate to a variant of its string value matches a known type.
Variants§
AppleTvOs
AppleTvSimulator
DriverKit
IPhoneOs
IPhoneSimulator
MacOsX
WatchOs
WatchSimulator
XrOs
XrOsSimulator
Unknown(String)
Implementations§
Source§impl Platform
impl Platform
Sourcepub fn from_platform_path(p: &Path) -> Result<Self, Error>
pub fn from_platform_path(p: &Path) -> Result<Self, Error>
Attempt to construct an instance from a filesystem path to a platform directory.
The argument should be the path of a *.platform
directory. e.g.
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform
.
Will return Error::PathNotPlatform if this does not appear to be a known platform path.
Sourcepub fn from_target_triple(target: &str) -> Result<Self, Error>
pub fn from_target_triple(target: &str) -> Result<Self, Error>
Attempt to construct an instance from a target triple.
The argument should be a target triple of a Rust toolchain. e.g.
x86_64-apple-darwin
.
Will return Error::UnknownTarget if this does not appear to be a known target triple.
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<Platform> for PlatformDirectory
impl AsRef<Platform> for PlatformDirectory
impl Eq for Platform
Auto Trait Implementations§
impl Freeze for Platform
impl RefUnwindSafe for Platform
impl Send for Platform
impl Sync for Platform
impl Unpin for Platform
impl UnwindSafe for Platform
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.