@@ -11,6 +11,7 @@ use serde::Serialize;
1111use url:: Url ;
1212
1313use crate :: core:: interning:: InternedString ;
14+ use crate :: core:: resolver:: ResolveBehavior ;
1415use crate :: core:: { Dependency , PackageId , PackageIdSpec , SourceId , Summary } ;
1516use crate :: core:: { Edition , Feature , Features , WorkspaceConfig } ;
1617use crate :: util:: errors:: * ;
@@ -45,6 +46,7 @@ pub struct Manifest {
4546 im_a_teapot : Option < bool > ,
4647 default_run : Option < String > ,
4748 metabuild : Option < Vec < String > > ,
49+ resolve_behavior : Option < ResolveBehavior > ,
4850}
4951
5052/// When parsing `Cargo.toml`, some warnings should silenced
@@ -67,6 +69,7 @@ pub struct VirtualManifest {
6769 profiles : Option < TomlProfiles > ,
6870 warnings : Warnings ,
6971 features : Features ,
72+ resolve_behavior : Option < ResolveBehavior > ,
7073}
7174
7275/// General metadata about a package which is just blindly uploaded to the
@@ -421,6 +424,7 @@ impl Manifest {
421424 default_run : Option < String > ,
422425 original : Rc < TomlManifest > ,
423426 metabuild : Option < Vec < String > > ,
427+ resolve_behavior : Option < ResolveBehavior > ,
424428 ) -> Manifest {
425429 Manifest {
426430 summary,
@@ -443,6 +447,7 @@ impl Manifest {
443447 default_run,
444448 publish_lockfile,
445449 metabuild,
450+ resolve_behavior,
446451 }
447452 }
448453
@@ -509,6 +514,13 @@ impl Manifest {
509514 & self . features
510515 }
511516
517+ /// The style of resolver behavior to use, declared with the `resolver` field.
518+ ///
519+ /// Returns `None` if it is not specified.
520+ pub fn resolve_behavior ( & self ) -> Option < ResolveBehavior > {
521+ self . resolve_behavior
522+ }
523+
512524 pub fn map_source ( self , to_replace : SourceId , replace_with : SourceId ) -> Manifest {
513525 Manifest {
514526 summary : self . summary . map_source ( to_replace, replace_with) ,
@@ -572,6 +584,7 @@ impl VirtualManifest {
572584 workspace : WorkspaceConfig ,
573585 profiles : Option < TomlProfiles > ,
574586 features : Features ,
587+ resolve_behavior : Option < ResolveBehavior > ,
575588 ) -> VirtualManifest {
576589 VirtualManifest {
577590 replace,
@@ -580,6 +593,7 @@ impl VirtualManifest {
580593 profiles,
581594 warnings : Warnings :: new ( ) ,
582595 features,
596+ resolve_behavior,
583597 }
584598 }
585599
@@ -610,6 +624,13 @@ impl VirtualManifest {
610624 pub fn features ( & self ) -> & Features {
611625 & self . features
612626 }
627+
628+ /// The style of resolver behavior to use, declared with the `resolver` field.
629+ ///
630+ /// Returns `None` if it is not specified.
631+ pub fn resolve_behavior ( & self ) -> Option < ResolveBehavior > {
632+ self . resolve_behavior
633+ }
613634}
614635
615636impl Target {
0 commit comments