pub struct BuildTarget<'g> { /* private fields */ }
Expand description
A build target in a package.
A build target consists of one or more source files which can be compiled into a crate.
For more, see Cargo Targets in the Cargo reference.
Implementations§
Source§impl<'g> BuildTarget<'g>
impl<'g> BuildTarget<'g>
Sourcepub fn id(&self) -> BuildTargetId<'g>
pub fn id(&self) -> BuildTargetId<'g>
Returns the unique identifier for this build target.
Sourcepub fn kind(&self) -> BuildTargetKind<'g>
pub fn kind(&self) -> BuildTargetKind<'g>
Returns the kind of this build target.
Sourcepub fn required_features(&self) -> &'g [String]
pub fn required_features(&self) -> &'g [String]
Returns the features required for this build target.
This setting has no effect on the library target.
For more, see The required-features
field
in the Cargo reference.
Sourcepub fn path(&self) -> &'g Utf8Path
pub fn path(&self) -> &'g Utf8Path
Returns the absolute path of the location where the source for this build target is located.
Sourcepub fn doc_by_default(&self) -> bool
pub fn doc_by_default(&self) -> bool
Returns true if documentation is generated for this build target by default.
This is true by default for library targets, as well as binaries that don’t share a name with the library they are in.
For more information, see the Cargo documentation.
Sourcepub fn doctest_by_default(&self) -> bool
pub fn doctest_by_default(&self) -> bool
Returns true if documentation tests are run by default for this build target.
For more information, see the Cargo documentation.
Sourcepub fn doc_tests(&self) -> bool
👎Deprecated since 0.17.16: use doctest_by_default
instead
pub fn doc_tests(&self) -> bool
doctest_by_default
insteadPrevious name for Self::doctest_by_default
.
Sourcepub fn test_by_default(&self) -> bool
pub fn test_by_default(&self) -> bool
Returns true if tests are run by default for this build target (i.e. if
tests are run even if --all-targets
isn’t specified).
This is true by default for libraries, binaries, and test targets.
For more information, see the Cargo documentation.
Auto Trait Implementations§
impl<'g> Freeze for BuildTarget<'g>
impl<'g> RefUnwindSafe for BuildTarget<'g>
impl<'g> Send for BuildTarget<'g>
impl<'g> Sync for BuildTarget<'g>
impl<'g> Unpin for BuildTarget<'g>
impl<'g> UnwindSafe for BuildTarget<'g>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more