Should make the distinction between getting the information and actually working with the information, especially once unit graph support is added.
WFBF7VS6OFN23TQBQGOPUOGMIHXVBTFJ2GFLDYET6IQLY7VOS7RAC
UKNTVY7Z7SSOL4KM7J26MZUTU6WP2D5346KMYCYS7WGKFBSDBJ2AC
L6QJNN62E4LA65OOTWGFK25QQNIJGLK3SJEEKAHOB5B7RXDUEZUQC
YA5ITLOV2UWAQZWFJND2WM45DLWG7PTECNJQOLPZAHH2GETPI3HQC
BRXHJFU7ANVWOFXBNR5EYUGDURCFCZIF66VDV6L3JBYC45CAFNJAC
C43IWI7GMF6UEKGTXTK4GSQLAFD2SH6BKQRGR4ZQNITYSUK6RMXAC
ZEN3WUPDVQWI7LPTEG3WQA5QSEHU74CUXVFJJFIJNSIFC7N2CMEAC
UXJFRBBL7IZ2PR7ZYNFGOJ6A7EH5ZVLYVFLA3HNFCNRVL6KWJUDAC
7CVIL7UJBYEZ4KHKPJ7ZYSVQ7BLQWWUSJLJR5FOXBICQTD5ETK4QC
UQJO24KBYI77E4J6LXWX2IUN7VABQKG6PGKBKWEPDCH5CKYBTC4AC
LOR3KOXGQ2VYGDHXQ6MG22ZME5TMPFTUW7A5OG36IAVQANOCXBRAC
V2NPEIA6ZXW2FE24IQBPLUICWIGMW7R2K7MNXUUKMOAAQWSQ36WQC
T34OV3YQGRFMXYWEFLBCFMX3U2TVXF552B5B3S6HMBJZU66PDMYAC
XVQXXAGZ4WHBQIU3WEUKLZX6FKV5V52LSTTGMFXR42WPWJZJNENQC
}
/// See https://doc.rust-lang.org/nightly/nightly-rustc/cargo/core/manifest/enum.TargetKind.html
/// and https://doc.rust-lang.org/nightly/nightly-rustc/cargo/core/manifest/enum.TargetKind.html#impl-Serialize-for-TargetKind
/// This is different to the original enum as `CrateType` has been manually flattened into this enum,
/// so some information is lost in favour of simplicity
// TODO: fix this limitation, make `TargetKind` match cargo's definition
#[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum TargetKind {
Lib,
Bin,
Test,
Bench,
ExampleLib,
ExampleBin,
CustomBuild,
Rlib,
Dylib,
Cdylib,
Staticlib,
ProcMacro,
/// See https://doc.rust-lang.org/nightly/nightly-rustc/cargo/core/manifest/struct.TargetInner.html
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct Target {
pub kind: Vec<TargetKind>,
pub name: String,
pub src_path: Utf8PathBuf,
pub edition: Edition,
pub doc: bool,
pub doctest: bool,
pub test: bool,
}
use camino::Utf8PathBuf;
use cargo_metadata::Edition;
use serde::{Deserialize, Serialize};
pub mod self_profile;
pub mod timings;
/// See https://docs.rs/cargo/latest/cargo/core/compiler/enum.CompileMode.html
/// These are the only two cases we are interested in
#[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum Mode {
Build,
RunCustomBuild,
}
/// See https://doc.rust-lang.org/nightly/nightly-rustc/cargo/core/manifest/enum.TargetKind.html
/// and https://doc.rust-lang.org/nightly/nightly-rustc/cargo/core/manifest/enum.TargetKind.html#impl-Serialize-for-TargetKind
/// This is different to the original enum as `CrateType` has been manually flattened into this enum,
/// so some information is lost in favour of simplicity
// TODO: fix this limitation, make `TargetKind` match cargo's definition
#[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum TargetKind {
Lib,
Bin,
Test,
Bench,
ExampleLib,
ExampleBin,
CustomBuild,
Rlib,
Dylib,
Cdylib,
Staticlib,
ProcMacro,
}
/// See https://doc.rust-lang.org/nightly/nightly-rustc/cargo/core/manifest/struct.TargetInner.html
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct Target {
pub kind: Vec<TargetKind>,
pub name: String,
pub src_path: Utf8PathBuf,
pub edition: Edition,
pub doc: bool,
pub doctest: bool,
pub test: bool,
}