pub struct Target { /* private fields */ }
Expand description
Information about a binary, a library, an example, etc. that is part of the package.
Implementations
sourceimpl 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 tested(&self) -> bool
pub fn harness(&self) -> bool
pub fn documented(&self) -> bool
pub fn for_host(&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
pub fn linkable(&self) -> bool
pub fn is_bin(&self) -> bool
pub fn is_example(&self) -> bool
pub fn is_bin_example(&self) -> bool
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_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
Trait Implementations
impl Eq for Target
impl StructuralEq for Target
impl StructuralPartialEq for Target
Auto Trait Implementations
impl RefUnwindSafe for Target
impl Send for Target
impl Sync for Target
impl Unpin for Target
impl UnwindSafe for Target
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more