@@ -10,6 +10,7 @@ use serde::Serialize;
1010use url:: Url ;
1111
1212use crate :: core:: interning:: InternedString ;
13+ use crate :: core:: resolver:: ResolveBehavior ;
1314use crate :: core:: { Dependency , PackageId , PackageIdSpec , SourceId , Summary } ;
1415use crate :: core:: { Edition , Feature , Features , WorkspaceConfig } ;
1516use crate :: util:: errors:: * ;
@@ -44,6 +45,7 @@ pub struct Manifest {
4445 im_a_teapot : Option < bool > ,
4546 default_run : Option < String > ,
4647 metabuild : Option < Vec < String > > ,
48+ resolve_behavior : Option < ResolveBehavior > ,
4749}
4850
4951/// When parsing `Cargo.toml`, some warnings should silenced
@@ -66,6 +68,7 @@ pub struct VirtualManifest {
6668 profiles : Option < TomlProfiles > ,
6769 warnings : Warnings ,
6870 features : Features ,
71+ resolve_behavior : Option < ResolveBehavior > ,
6972}
7073
7174/// General metadata about a package which is just blindly uploaded to the
@@ -410,6 +413,7 @@ impl Manifest {
410413 default_run : Option < String > ,
411414 original : Rc < TomlManifest > ,
412415 metabuild : Option < Vec < String > > ,
416+ resolve_behavior : Option < ResolveBehavior > ,
413417 ) -> Manifest {
414418 Manifest {
415419 summary,
@@ -432,6 +436,7 @@ impl Manifest {
432436 default_run,
433437 publish_lockfile,
434438 metabuild,
439+ resolve_behavior,
435440 }
436441 }
437442
@@ -501,6 +506,13 @@ impl Manifest {
501506 & self . features
502507 }
503508
509+ /// The style of resolver behavior to use, declared with the `resolver` field.
510+ ///
511+ /// Returns `None` if it is not specified.
512+ pub fn resolve_behavior ( & self ) -> Option < ResolveBehavior > {
513+ self . resolve_behavior
514+ }
515+
504516 pub fn map_source ( self , to_replace : SourceId , replace_with : SourceId ) -> Manifest {
505517 Manifest {
506518 summary : self . summary . map_source ( to_replace, replace_with) ,
@@ -564,6 +576,7 @@ impl VirtualManifest {
564576 workspace : WorkspaceConfig ,
565577 profiles : Option < TomlProfiles > ,
566578 features : Features ,
579+ resolve_behavior : Option < ResolveBehavior > ,
567580 ) -> VirtualManifest {
568581 VirtualManifest {
569582 replace,
@@ -572,6 +585,7 @@ impl VirtualManifest {
572585 profiles,
573586 warnings : Warnings :: new ( ) ,
574587 features,
588+ resolve_behavior,
575589 }
576590 }
577591
@@ -602,6 +616,13 @@ impl VirtualManifest {
602616 pub fn features ( & self ) -> & Features {
603617 & self . features
604618 }
619+
620+ /// The style of resolver behavior to use, declared with the `resolver` field.
621+ ///
622+ /// Returns `None` if it is not specified.
623+ pub fn resolve_behavior ( & self ) -> Option < ResolveBehavior > {
624+ self . resolve_behavior
625+ }
605626}
606627
607628impl Target {
0 commit comments