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 name_inferred(&self) -> bool
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_name_inferred(&mut self, inferred: bool) -> &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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§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 Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§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>,
§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