pub struct Target {
pub name: TargetName,
pub kind: TargetKind,
pub sources: Vec<Utf8PathBuf>,
pub include_dirs: Vec<Utf8PathBuf>,
pub defines: Vec<String>,
pub deps: Vec<TargetDep>,
pub required_features: Vec<String>,
pub language: LanguageStandardSettings,
}Expand description
A buildable unit within a package.
Fields§
§name: TargetName§kind: TargetKind§sources: Vec<Utf8PathBuf>§include_dirs: Vec<Utf8PathBuf>§defines: Vec<String>§deps: Vec<TargetDep>Explicit references to the linked targets. A bare name
resolves to a same-package target first, then as the
same-name shorthand on a dependency package (foo means
foo:foo, matching the dependency’s library / header-only
targets only); every other cross-package reference is the
qualified package:target form. A package dependency only
makes the package available - it never exports a default
target, so a bare name that matches neither a local target
nor a same-named linkable dependency target is a hard error.
Resolution against a concrete package graph lives in
cabin-build, not here.
References are stored as raw strings, not TargetName, because
the qualified package:target form contains a : that the
path-safe target-name grammar rejects. Validation happens at
resolution time against the already-validated package / target
graph; dep strings never flow directly into a filesystem path.
Each entry also carries the declared per-edge visibility - see
TargetDep.
required_features: Vec<String>Package features that must all be enabled for this target
to be built or used. Entries name features declared in the
owning package’s [features] table;
Package::with_config rejects unknown names. Default
target enumeration skips a target whose required features
are not enabled; naming one explicitly (a deps entry, a
manifest-target selector, cabin test --test) is a hard
error instead.
language: LanguageStandardSettingsPer-target c-standard / cxx-standard /
interface-c-standard / interface-cxx-standard overrides.
Interface fields are only meaningful on library /
header-only kinds; the manifest parser rejects them on
executable-like targets.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Target
impl<'de> Deserialize<'de> for Target
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.