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<CrateType>,
src_path: PathBuf,
edition: Edition
) -> Target
pub fn bin_target(
name: &str,
bin_name: Option<String>,
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<CrateType>,
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 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 is_lib(&self) -> bool
pub fn is_dylib(&self) -> bool
pub fn is_cdylib(&self) -> bool
sourcepub fn is_linkable(&self) -> bool
pub fn is_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<CrateType>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn rustc_crate_types(&self) -> Vec<CrateType>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Returns the arguments suitable for --crate-type
to pass to rustc.
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 set_kind(&mut self, kind: TargetKind) -> &mut Target
pub fn set_name(&mut self, name: &str) -> &mut Target
pub fn set_binary_name(&mut self, bin_name: Option<String>) -> &mut Target
pub fn set_required_features(
&mut self,
required_features: Option<Vec<String>>
) -> &mut Target
pub fn binary_filename(&self) -> Option<String>
pub fn description_named(&self) -> String
Trait Implementations
sourceimpl Ord for Target
impl Ord for Target
sourceimpl PartialOrd<Target> for Target
impl PartialOrd<Target> for Target
sourcefn partial_cmp(&self, other: &Target) -> Option<Ordering>
fn partial_cmp(&self, other: &Target) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more