pub struct Target {
pub key: String,
pub os: String,
pub cpu: String,
pub triple: String,
pub windows: bool,
}Expand description
A resolved platform: the npm key, its npm os/cpu install filters, the
Rust target triple to build, and whether the binary carries a .exe.
Fields§
§key: String§os: String§cpu: String§triple: String§windows: boolImplementations§
Source§impl Target
impl Target
Sourcepub fn from_triple(triple: &str) -> Result<Self, TargetError>
pub fn from_triple(triple: &str) -> Result<Self, TargetError>
Build a target by decomposing a Rust target triple into npm os/cpu/key.
Sourcepub fn from_spec(spec: &TargetSpec) -> Result<Self, TargetError>
pub fn from_spec(spec: &TargetSpec) -> Result<Self, TargetError>
Build a target from a user spec: the triple defaults from the key, and the os/cpu default from the key’s two segments.
Sourcepub fn binary_filename(&self, stem: &str) -> String
pub fn binary_filename(&self, stem: &str) -> String
File name of stem for this platform (appends .exe on Windows).
Sourcepub fn binary_path(&self, target_directory: &Path, bin: &str) -> PathBuf
pub fn binary_path(&self, target_directory: &Path, bin: &str) -> PathBuf
Path of the compiled bin under cargo’s target directory:
<target_dir>/<triple>/release/<bin>[.exe].
Trait Implementations§
impl Eq for Target
impl StructuralPartialEq for Target
Auto Trait Implementations§
impl Freeze for Target
impl RefUnwindSafe for Target
impl Send for Target
impl Sync for Target
impl Unpin for Target
impl UnsafeUnpin for Target
impl UnwindSafe for Target
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
Mutably borrows from an owned value. Read more