pub enum StalenessReason {
MissingDependency {
name: String,
resource_type: ResourceType,
},
VersionChanged {
name: String,
resource_type: ResourceType,
old_version: String,
new_version: String,
},
PathChanged {
name: String,
resource_type: ResourceType,
old_path: String,
new_path: String,
},
SourceUrlChanged {
name: String,
old_url: String,
new_url: String,
},
DuplicateEntries {
name: String,
resource_type: ResourceType,
count: usize,
},
ToolChanged {
name: String,
resource_type: ResourceType,
old_tool: String,
new_tool: String,
},
}
Expand description
Reasons why a lockfile might be considered stale.
This enum describes various conditions that indicate a lockfile is out-of-sync with the manifest and needs to be regenerated to prevent installation errors or inconsistencies.
§Display Format
Each variant implements Display
to provide user-friendly error messages
that explain the problem and suggest solutions.
§Examples
use agpm_cli::lockfile::StalenessReason;
use agpm_cli::core::ResourceType;
let reason = StalenessReason::MissingDependency {
name: "my-agent".to_string(),
resource_type: ResourceType::Agent,
};
println!("{}", reason);
// Output: "Dependency 'my-agent' (agent) is in manifest but missing from lockfile"
Variants§
MissingDependency
A dependency is in the manifest but not in the lockfile. This indicates the lockfile is incomplete and needs regeneration.
Fields
resource_type: ResourceType
Type of resource (agent, snippet, etc.)
VersionChanged
A dependency’s version constraint has changed in the manifest.
Fields
resource_type: ResourceType
Type of resource (agent, snippet, etc.)
PathChanged
A dependency’s path has changed in the manifest.
Fields
resource_type: ResourceType
Type of resource (agent, snippet, etc.)
SourceUrlChanged
A source repository has a different URL in the manifest. This is a security concern as it could point to a different repository.
Fields
DuplicateEntries
Multiple entries exist for the same dependency (lockfile corruption).
Fields
resource_type: ResourceType
Type of resource (agent, snippet, etc.)
ToolChanged
A dependency’s tool field has changed in the manifest.
Trait Implementations§
Source§impl Clone for StalenessReason
impl Clone for StalenessReason
Source§fn clone(&self) -> StalenessReason
fn clone(&self) -> StalenessReason
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for StalenessReason
impl Debug for StalenessReason
Source§impl Display for StalenessReason
impl Display for StalenessReason
Source§impl Error for StalenessReason
impl Error for StalenessReason
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl PartialEq for StalenessReason
impl PartialEq for StalenessReason
impl Eq for StalenessReason
impl StructuralPartialEq for StalenessReason
Auto Trait Implementations§
impl Freeze for StalenessReason
impl RefUnwindSafe for StalenessReason
impl Send for StalenessReason
impl Sync for StalenessReason
impl Unpin for StalenessReason
impl UnwindSafe for StalenessReason
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.