pub struct Target { /* private fields */ }Expand description
Information about a binary, a library, an example, etc. that is part of the package.
Implementations§
Source§impl Target
impl Target
pub fn lib_target( name: &str, crate_targets: Vec<LibKind>, src_path: PathBuf, edition: Edition, ) -> Target
pub fn bin_target( name: &str, src_path: PathBuf, required_features: Option<Vec<String>>, edition: Edition, ) -> Target
Sourcepub fn custom_build_target(
name: &str,
src_path: PathBuf,
edition: Edition,
) -> Target
pub fn custom_build_target( name: &str, src_path: PathBuf, edition: Edition, ) -> Target
Builds a Target corresponding to the build = "build.rs" entry.
pub fn metabuild_target(name: &str) -> Target
pub fn example_target( name: &str, crate_targets: Vec<LibKind>, src_path: PathBuf, required_features: Option<Vec<String>>, edition: Edition, ) -> Target
pub fn test_target( name: &str, src_path: PathBuf, required_features: Option<Vec<String>>, edition: Edition, ) -> Target
pub fn bench_target( name: &str, src_path: PathBuf, required_features: Option<Vec<String>>, edition: Edition, ) -> Target
pub fn name(&self) -> &str
pub fn crate_name(&self) -> String
pub fn src_path(&self) -> &TargetSourcePath
pub fn set_src_path(&mut self, src_path: TargetSourcePath)
pub fn required_features(&self) -> Option<&Vec<String>>
pub fn kind(&self) -> &TargetKind
pub fn kind_mut(&mut self) -> &mut TargetKind
pub fn tested(&self) -> bool
pub fn harness(&self) -> bool
pub fn documented(&self) -> bool
pub fn for_host(&self) -> bool
pub fn proc_macro(&self) -> bool
pub fn edition(&self) -> Edition
pub fn benched(&self) -> bool
pub fn doctested(&self) -> bool
pub fn doctestable(&self) -> bool
pub fn allows_underscores(&self) -> bool
pub fn is_lib(&self) -> bool
pub fn is_dylib(&self) -> bool
pub fn is_cdylib(&self) -> bool
Sourcepub fn linkable(&self) -> bool
pub fn linkable(&self) -> bool
Returns whether this target produces an artifact which can be linked into a Rust crate.
This only returns true for certain kinds of libraries.
pub fn is_bin(&self) -> bool
pub fn is_example(&self) -> bool
Sourcepub fn is_executable(&self) -> bool
pub fn is_executable(&self) -> bool
Returns true if it is a binary or executable example.
NOTE: Tests are false!
Sourcepub fn is_exe_example(&self) -> bool
pub fn is_exe_example(&self) -> bool
Returns true if it is an executable example.
pub fn is_test(&self) -> bool
pub fn is_bench(&self) -> bool
pub fn is_custom_build(&self) -> bool
Sourcepub fn rustc_crate_types(&self) -> Vec<&str>
pub fn rustc_crate_types(&self) -> Vec<&str>
Returns the arguments suitable for --crate-type to pass to rustc.
pub fn can_lto(&self) -> bool
pub fn set_tested(&mut self, tested: bool) -> &mut Target
pub fn set_benched(&mut self, benched: bool) -> &mut Target
pub fn set_doctest(&mut self, doctest: bool) -> &mut Target
pub fn set_for_host(&mut self, for_host: bool) -> &mut Target
pub fn set_proc_macro(&mut self, proc_macro: bool) -> &mut Target
pub fn set_edition(&mut self, edition: Edition) -> &mut Target
pub fn set_harness(&mut self, harness: bool) -> &mut Target
pub fn set_doc(&mut self, doc: bool) -> &mut Target
pub fn description_named(&self) -> String
Trait Implementations§
Source§impl Ord for Target
impl Ord for Target
Source§impl PartialOrd for Target
impl PartialOrd for Target
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 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