pub enum CargoError {
InvalidName(String),
InvalidVersion(String),
InvalidPublish(String),
ChecksumMismatch {
declared: String,
computed: String,
},
NotFound(String),
NotImplemented(String),
Storage(BlobStoreError),
}Expand description
Errors raised by the Cargo registry protocol.
Variants§
InvalidName(String)
A crate name failed validation (registry §“Crate name restrictions”).
InvalidVersion(String)
A version string is not legal semver.
InvalidPublish(String)
The publish request body is malformed (LE-length / JSON / tarball mismatch).
ChecksumMismatch
The declared cksum did not match the tarball SHA-256.
NotFound(String)
The requested resource does not exist.
NotImplemented(String)
Feature not yet implemented in this phase (Git index).
Storage(BlobStoreError)
Underlying blob-store error (I/O, digest mismatch, missing blob).
Implementations§
Source§impl CargoError
impl CargoError
Sourcepub fn status(&self) -> StatusCode
pub fn status(&self) -> StatusCode
HTTP status code for this 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)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<BlobStoreError> for CargoError
impl From<BlobStoreError> for CargoError
Source§fn from(source: BlobStoreError) -> Self
fn from(source: BlobStoreError) -> Self
Converts to this type from the input type.
Source§impl IntoResponse for CargoError
impl IntoResponse for CargoError
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Create a response.
Auto Trait Implementations§
impl Freeze for CargoError
impl !RefUnwindSafe for CargoError
impl Send for CargoError
impl Sync for CargoError
impl Unpin for CargoError
impl UnsafeUnpin 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
Mutably borrows from an owned value. Read more