pub enum Error {
NotFound,
MultipleLinks,
Malformed(&'static str),
Inaccessible,
}Expand description
Errors from locating a C2PA Manifest Store via an HTTP Link header.
§What carries a status code
Locating a manifest by reference is a prerequisite to validation. A response
with no c2pa-manifest link simply has no provenance to check, which is not
a failure.
The one registered code that belongs to this crate is
manifest.inaccessible: the specification requires it when a manifest “was
documented to exist in a remote location, but is not present there, or the
location is not currently available (such as in an offline scenario)”. This
crate performs no network I/O, so it never raises that itself — it is
exposed as Error::Inaccessible for the caller that does the fetching to
report through the same type.
Variants§
NotFound
No Link header with rel="c2pa-manifest" was present.
MultipleLinks
More than one distinct c2pa-manifest target was advertised.
The specification describes retrieving “a” Manifest Store from “that URI reference” and defines no precedence between competing links, so picking one would be inventing a rule. Duplicate links naming the same target are not an error.
Malformed(&'static str)
A Link field value could not be parsed as RFC 8288.
Inaccessible
A manifest was advertised but could not be retrieved.
Reported as manifest.inaccessible. Raised by the caller performing the
fetch, not by this crate.
Implementations§
Source§impl Error
impl Error
Sourcepub fn code(&self) -> Option<&'static str>
pub fn code(&self) -> Option<&'static str>
The registered C2PA validation status code for this error, or None
when the condition carries no status code.
Sourcepub fn is_no_manifest_located(&self) -> bool
pub fn is_no_manifest_located(&self) -> bool
Whether this means the response advertised no provenance at all, as opposed to provenance that was advertised and could not be used.
Trait Implementations§
impl Eq for Error
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()