workspacer_interface/
cargo_toml_interface.rs1crate::ix!();
3
4pub trait CargoTomlInterface
5: CheckExistence<Error=CargoTomlError>
6+ Send
7+ Sync
8+ PinWildcardDependencies<Error=CargoTomlError>
9+ CheckRequiredFieldsForPublishing<Error=CargoTomlError>
10+ CheckVersionValidityForPublishing<Error=CargoTomlError>
11+ CheckRequiredFieldsForIntegrity<Error=CargoTomlError>
12+ CheckVersionValidityForIntegrity<Error=CargoTomlError>
13+ GetPackageSection<Error=CargoTomlError>
14+ ReadyForCargoPublish<Error=CargoTomlError>
15+ IsValidVersion
16+ ValidateIntegrity<Error=CargoTomlError>
17+ AsRef<Path>
18{}
19
20pub type LockVersionMap = BTreeMap<String, BTreeSet<semver::Version>>;
21
22#[async_trait]
23pub trait PinWildcardDependencies {
24
25 type Error;
26
27 async fn pin_wildcard_dependencies(
28 &self,
29 lock_versions: &LockVersionMap,
30 ) -> Result<(), Self::Error>;
31}
32
33pub trait CheckExistence {
34
35 type Error;
36
37 fn check_existence(&self) -> Result<(), Self::Error>;
38}
39
40pub trait CheckRequiredFieldsForPublishing {
41
42 type Error;
43
44 fn check_required_fields_for_publishing(&self) -> Result<(), Self::Error>;
46}
47
48pub trait CheckVersionValidityForPublishing {
49
50 type Error;
51
52 fn check_version_validity_for_publishing(&self) -> Result<(), Self::Error>;
54}
55
56pub trait CheckRequiredFieldsForIntegrity {
57
58 type Error;
59
60 fn check_required_fields_for_integrity(&self) -> Result<(), Self::Error>;
62}
63
64pub trait CheckVersionValidityForIntegrity {
65
66 type Error;
67
68 fn check_version_validity_for_integrity(&self) -> Result<(), Self::Error>;
70}
71
72pub trait GetPackageSection {
73
74 type Error;
75
76 fn get_package_section(&self) -> Result<&toml::Value, Self::Error>;
78}
79
80pub trait IsValidVersion {
81
82 fn is_valid_version(&self, version: &str) -> bool;
84}