Public declaration syntax from forge-rs/crates/forge-provider-session/src/error.rs Original source SHA-256: ac1d98ece9f023373709204a0e7515fe3719d0b2ea759c8b140e57f01c138911 Function bodies and constant values are omitted. This is not the complete implementation. Source line 13 #[derive(Debug, Error)] pub enum ProviderSessionError { /// The requested provider is not allowed by the active session policy. #[error( "provider '{provider_ref}' is not allowed by session policy '{policy_name}': {reason}" )] ProviderNotAllowed { /// The provider reference that was denied. provider_ref: String, /// The name of the policy that denied the request. policy_name: String, /// Human-readable explanation of why the provider was denied. reason: String, }, /// A session was not found for the given ID. #[error("session '{session_id}' not found in session manager")] SessionNotFound { /// The session ID that was looked up. session_id: String, }, /// An invalid session state transition was attempted. #[error("invalid session transition from {from:?} to {to:?}: {reason}")] InvalidSessionTransition { /// The current session state. from: super::session::SessionState, /// The attempted target state. to: super::session::SessionState, /// Human-readable explanation of why the transition is invalid. reason: String, }, /// A session has expired and cannot be used. #[error("session '{session_id}' expired at {expired_at}; create a new session")] SessionExpired { /// The expired session ID. session_id: String, /// When the session expired (ISO 8601). expired_at: String, }, /// A runtime provider swap was attempted but the policy forbids it. #[error( "runtime provider swap from '{from_provider}' to '{to_provider}' denied by policy '{policy_name}': runtime swapping is disabled" )] RuntimeSwapDenied { /// The current provider. from_provider: String, /// The requested new provider. to_provider: String, /// The policy that denied the swap. policy_name: String, }, /// No default provider is configured in the session policy. #[error("no default provider configured in session policy '{policy_name}'; set a default_provider in the SessionPolicy")] NoDefaultProvider { /// The policy that lacks a default provider. policy_name: String, }, /// The session policy is invalid. #[error("invalid session policy: {reason}")] InvalidPolicy { /// What is wrong with the policy. reason: String, }, /// A Forge core error occurred. #[error("forge core error: {0}")] ForgeCore(#[from] forge_core::error::ForgeError), } Source line 87 pub type ProviderSessionResult = Result;