pub struct ResolutionContext<'a> { /* private fields */ }Expand description
Runtime facts that affect configuration resolution.
The resolver cannot infer the running CLI’s version from this crate’s package version: a
library release and an adopting CLI release are unrelated, and a CLI may compute its version at
runtime. Pass it explicitly with ResolutionContext::for_cli_version when lifecycle gates
should be enforced.
Implementations§
Source§impl<'a> ResolutionContext<'a>
impl<'a> ResolutionContext<'a>
Sourcepub const fn new() -> Self
pub const fn new() -> Self
A context with no CLI version.
This preserves the historical resolve behavior: deprecations warn immediately, while
removal milestones do not discard values when the resolver cannot know whether they have
been reached.
Sourcepub const fn for_cli_version(version: &'a str) -> Self
pub const fn for_cli_version(version: &'a str) -> Self
A context for the running CLI version.
Sourcepub const fn cli_version(self) -> Option<&'a str>
pub const fn cli_version(self) -> Option<&'a str>
The running CLI version, if the caller supplied one.
Trait Implementations§
Source§impl<'a> Clone for ResolutionContext<'a>
impl<'a> Clone for ResolutionContext<'a>
Source§fn clone(&self) -> ResolutionContext<'a>
fn clone(&self) -> ResolutionContext<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for ResolutionContext<'a>
Source§impl<'a> Debug for ResolutionContext<'a>
impl<'a> Debug for ResolutionContext<'a>
Source§impl<'a> Default for ResolutionContext<'a>
impl<'a> Default for ResolutionContext<'a>
Source§fn default() -> ResolutionContext<'a>
fn default() -> ResolutionContext<'a>
Returns the “default value” for a type. Read more
impl<'a> Eq for ResolutionContext<'a>
Source§impl<'a> PartialEq for ResolutionContext<'a>
impl<'a> PartialEq for ResolutionContext<'a>
impl<'a> StructuralPartialEq for ResolutionContext<'a>
Auto Trait Implementations§
impl<'a> Freeze for ResolutionContext<'a>
impl<'a> RefUnwindSafe for ResolutionContext<'a>
impl<'a> Send for ResolutionContext<'a>
impl<'a> Sync for ResolutionContext<'a>
impl<'a> Unpin for ResolutionContext<'a>
impl<'a> UnsafeUnpin for ResolutionContext<'a>
impl<'a> UnwindSafe for ResolutionContext<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more