pub struct Target {
inner: Arc<TargetInner>,
}
Expand description
Information about a binary, a library, an example, etc. that is part of the package.
Fields§
§inner: Arc<TargetInner>
Implementations§
source§impl Target
impl Target
fn new(src_path: TargetSourcePath, edition: Edition) -> Target
fn with_path(src_path: PathBuf, edition: Edition) -> 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 doc_scrape_examples(&self) -> RustdocScrapeExamples
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
pub fn is_staticlib(&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>
pub fn rustc_crate_types(&self) -> Vec<CrateType>
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_doc_scrape_examples( &mut self, doc_scrape_examples: RustdocScrapeExamples ) -> &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§
source§impl Ord for Target
impl Ord for Target
source§impl PartialEq<Target> for Target
impl PartialEq<Target> for Target
source§impl PartialOrd<Target> for Target
impl PartialOrd<Target> for Target
1.0.0 · source§fn 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 moreimpl 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§
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> Serialize for Twhere
T: Serialize + ?Sized,
impl<T> Serialize for Twhere T: Serialize + ?Sized,
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>
source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 8 bytes