pub struct SpirvTarget { /* private fields */ }Expand description
A well-formed rust-gpu target.
The constructors only check whether the target is well-formed, not whether it is valid. Since spirv-builder is
backwards compatible with older rust-gpu compilers, only the compiler itself knows what targets it can and cannot
support. This also allows adding new targets to the compiler without having to update spirv-builder and
cargo-gpu.
Differentiates between a full target (e.g. spirv-unknown-vulkan1.3) and a target env (e.g. vulkan1.3). Use
Self::parse_target and Self::target to parse or format a full target, or use Self::parse_env and
Self::env when dealing with just target envs. The convenience function Self::parse accepts both targets and
target envs. Does not implement Display, since it is unclear whether the user wants a target or target env, though
a Debug implementation is provided.
Implementations§
Source§impl SpirvTarget
impl SpirvTarget
Sourcepub fn parse(target_or_env: &str) -> Result<SpirvTarget, TargetError>
pub fn parse(target_or_env: &str) -> Result<SpirvTarget, TargetError>
Try to parse either a full target or a target env
Sourcepub fn parse_target(target: &str) -> Result<SpirvTarget, TargetError>
pub fn parse_target(target: &str) -> Result<SpirvTarget, TargetError>
Parse a full target, e.g. spirv-unknown-vulkan1.3
Sourcepub fn parse_env(target_env: &str) -> Result<SpirvTarget, TargetError>
pub fn parse_env(target_env: &str) -> Result<SpirvTarget, TargetError>
Parse a target env, e.g. vulkan1.3
Trait Implementations§
Source§impl Clone for SpirvTarget
impl Clone for SpirvTarget
Source§fn clone(&self) -> SpirvTarget
fn clone(&self) -> SpirvTarget
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source. Read more