File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
crates/cargo-util-schemas/src Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 1010
1111pub mod core;
1212pub mod manifest;
13+ pub mod messages;
1314#[ cfg( feature = "unstable-schema" ) ]
1415pub mod schema;
1516
Original file line number Diff line number Diff line change 1+ //! Schemas for JSON messages emitted by Cargo.
2+
3+ use std:: collections:: BTreeMap ;
4+ use std:: path:: PathBuf ;
5+
6+ /// File information of a package archive generated by `cargo package --list`.
7+ #[ derive( Debug , serde:: Serialize ) ]
8+ #[ serde( rename_all = "snake_case" ) ]
9+ pub struct PackageList {
10+ /// The Package ID Spec of the package.
11+ pub id : crate :: core:: PackageIdSpec ,
12+ /// A map of relative paths in the archive to their detailed file information.
13+ pub files : BTreeMap < PathBuf , PackageFile > ,
14+ }
15+
16+ /// Where the file is from.
17+ #[ derive( Debug , serde:: Serialize ) ]
18+ #[ serde( rename_all = "snake_case" , tag = "kind" ) ]
19+ pub enum PackageFile {
20+ /// File being copied from another location.
21+ Copy {
22+ /// An absolute path to the actual file content
23+ path : PathBuf ,
24+ } ,
25+ /// File being generated during packaging
26+ Generate {
27+ /// An absolute path to the original file the generated one is based on.
28+ /// if any.
29+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
30+ path : Option < PathBuf > ,
31+ } ,
32+ }
You can’t perform that action at this time.
0 commit comments