pub enum Error {
UnknownFormat,
Malformed(String),
NotFound,
EmptySource,
MalformedReference(String),
MultipleManifests(Format),
MalformedExclusion(String),
HashMismatch,
UnsupportedAlgorithm(String),
Io(Error),
}Expand description
Errors returned by the crate.
Variants§
UnknownFormat
The bytes did not match any supported ML model container format.
Malformed(String)
The container was structurally malformed for its detected format.
NotFound
No C2PA manifest was present in the model.
EmptySource
A manifest source carried neither an embedded store nor a remote URI.
MalformedReference(String)
A stored manifest reference could not be decoded (e.g. invalid Base64).
MultipleManifests(Format)
More than one c2pa:manifest entry was present.
Only one shall be present per file. The specification assigns a distinct
failure code per format; see Error::code.
MalformedExclusion(String)
The exclusion ranges are malformed: out of order, overlapping, extending past the end of the file, or not matching the located manifest value.
For SafeTensors this also covers an 8-byte header length field that
disagrees with the actual JSON header length, which the specification
requires a validator to reject with assertion.dataHash.malformed.
HashMismatch
The recomputed data hash did not match the value in the assertion.
UnsupportedAlgorithm(String)
A hash algorithm identifier outside the C2PA allowed list was requested.
Io(Error)
Implementations§
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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
use the Display impl or to_string()