pub enum Error {
Show 24 variants
InvalidArchive(ZipError),
Json(Error),
Io(Error),
MissingFile {
path: String,
},
InvalidManifest {
reason: String,
},
UnsupportedVersion {
version: String,
},
HashMismatch {
path: String,
expected: String,
actual: String,
},
DocumentIdMismatch {
expected: String,
actual: String,
},
InvalidStateTransition {
from: DocumentState,
to: DocumentState,
},
StateRequirementNotMet {
state: DocumentState,
requirement: String,
},
PathTraversal {
path: String,
},
UnsupportedHashAlgorithm {
algorithm: String,
},
InvalidHashFormat {
value: String,
},
FileNotFound {
path: PathBuf,
},
InvalidCertificate {
reason: String,
},
Network {
message: String,
},
NotImplemented {
feature: String,
},
ImmutableDocument {
action: String,
state: DocumentState,
},
ExtensionNotAvailable {
extension: String,
},
ValidationFailed {
reason: String,
},
SignatureError {
reason: String,
},
EncryptionError {
reason: String,
},
FileTooLarge {
path: String,
size: u64,
limit: u64,
},
InvalidArchiveStructure {
reason: String,
},
}Expand description
Errors that can occur when working with Codex documents.
Variants§
InvalidArchive(ZipError)
The file is not a valid ZIP archive.
Json(Error)
JSON parsing or serialization failed.
Io(Error)
I/O operation failed.
MissingFile
A required file is missing from the archive.
InvalidManifest
The manifest is invalid.
UnsupportedVersion
The document’s Codex version is not supported.
HashMismatch
Hash verification failed.
Fields
DocumentIdMismatch
Document ID verification failed.
InvalidStateTransition
Invalid document state transition.
StateRequirementNotMet
State requirements not met.
Fields
state: DocumentStateThe document state with unmet requirements.
PathTraversal
Path traversal attempt detected (security).
UnsupportedHashAlgorithm
Hash algorithm is not supported.
InvalidHashFormat
Invalid hash format.
FileNotFound
File not found.
InvalidCertificate
Invalid certificate.
Network
Network operation failed.
NotImplemented
Feature not implemented.
ImmutableDocument
Cannot modify document in immutable state.
ExtensionNotAvailable
Extension not found or not loaded.
ValidationFailed
Content validation failed.
SignatureError
Signature operation failed.
EncryptionError
Encryption operation failed.
FileTooLarge
File exceeds the maximum allowed size (decompression bomb protection).
Fields
InvalidArchiveStructure
Archive structure is invalid.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl !UnwindSafe for Error
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> 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> 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.