pub enum CargoError {
TomlParseError {
source: TomlError,
},
InvalidVersionSpecifier {
specifier: String,
message: String,
},
PackageNotFound {
package: String,
},
RegistryError {
package: String,
source: Box<dyn Error + Send + Sync>,
},
ApiResponseError {
package: String,
source: Error,
},
InvalidStructure {
message: String,
},
MissingField {
section: String,
field: String,
},
WorkspaceError {
message: String,
},
InvalidUri {
uri: String,
},
CacheError(String),
Io(Error),
Other(Box<dyn Error + Send + Sync>),
}Expand description
Errors specific to Cargo/Rust dependency handling.
These errors cover parsing Cargo.toml files, validating semver specifications, and communicating with the crates.io registry.
Variants§
TomlParseError
Failed to parse Cargo.toml
Fields
source: TomlErrorInvalidVersionSpecifier
Invalid semver version specifier
PackageNotFound
Package not found on crates.io
RegistryError
crates.io registry request failed
ApiResponseError
Failed to deserialize crates.io API response
InvalidStructure
Invalid Cargo.toml structure
MissingField
Missing required field in Cargo.toml
WorkspaceError
Workspace configuration error
InvalidUri
Invalid file URI
CacheError(String)
Cache error
Io(Error)
I/O error
Other(Box<dyn Error + Send + Sync>)
Generic error wrapper
Implementations§
Source§impl CargoError
impl CargoError
Sourcepub fn registry_error(
package: impl Into<String>,
error: impl Error + Send + Sync + 'static,
) -> Self
pub fn registry_error( package: impl Into<String>, error: impl Error + Send + Sync + 'static, ) -> Self
Create a registry error from any error type.
Sourcepub fn api_response_error(package: impl Into<String>, error: Error) -> Self
pub fn api_response_error(package: impl Into<String>, error: Error) -> Self
Create an API response error.
Sourcepub fn invalid_structure(message: impl Into<String>) -> Self
pub fn invalid_structure(message: impl Into<String>) -> Self
Create an invalid structure error.
Sourcepub fn missing_field(
section: impl Into<String>,
field: impl Into<String>,
) -> Self
pub fn missing_field( section: impl Into<String>, field: impl Into<String>, ) -> Self
Create a missing field error.
Sourcepub fn invalid_version_specifier(
specifier: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn invalid_version_specifier( specifier: impl Into<String>, message: impl Into<String>, ) -> Self
Create an invalid version specifier error.
Sourcepub fn workspace_error(message: impl Into<String>) -> Self
pub fn workspace_error(message: impl Into<String>) -> Self
Create a workspace error.
Sourcepub fn invalid_uri(uri: impl Into<String>) -> Self
pub fn invalid_uri(uri: impl Into<String>) -> Self
Create an invalid URI error.
Trait Implementations§
Source§impl Debug for CargoError
impl Debug for CargoError
Source§impl Display for CargoError
impl Display for CargoError
Source§impl Error for CargoError
impl Error for CargoError
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 From<CargoError> for DepsError
Convert to deps_core::DepsError for interoperability
impl From<CargoError> for DepsError
Convert to deps_core::DepsError for interoperability
Source§fn from(err: CargoError) -> Self
fn from(err: CargoError) -> Self
Source§impl From<DepsError> for CargoError
Convert from deps_core::DepsError for compatibility
impl From<DepsError> for CargoError
Convert from deps_core::DepsError for compatibility
Auto Trait Implementations§
impl Freeze for CargoError
impl !RefUnwindSafe for CargoError
impl Send for CargoError
impl Sync for CargoError
impl Unpin for CargoError
impl !UnwindSafe for CargoError
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.