pub enum Error {
NotVtt,
NotFound,
MultipleManifests,
EmptyReference,
MalformedReference(String),
ExclusionOutOfRange,
}Expand description
Errors returned when embedding, extracting, or hard-binding a manifest.
Variants§
NotVtt
The input does not begin with the WEBVTT signature line.
NotFound
No manifest NOTE block was found in the file.
MultipleManifests
More than one manifest NOTE block was found. Per the C2PA structured
text embedding rules there shall be at most one; the file is rejected.
EmptyReference
A manifest NOTE block was found but the reference between the
delimiters is empty.
MalformedReference(String)
The manifest reference could not be parsed (e.g. a malformed
data:application/c2pa;base64,... URI).
ExclusionOutOfRange
The hard-binding exclusion range extends beyond the end of the asset.
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.
WebVTT is carried by the structured-text method, for which the specification defines no format-specific codes — unlike HTML or unstructured text. Only the data-hash condition maps to a code.
Every crate in this family exposes this method, so a dispatcher handling several embedding methods can ask the same question of any of them.
Sourcepub fn is_no_manifest_located(&self) -> bool
pub fn is_no_manifest_located(&self) -> bool
Whether this error means the asset carries no provenance at all, as opposed to provenance that was found and rejected.
Error::MultipleManifests counts: the structured-text rules require
an asset with more than one manifest block to be treated as if no
manifests were located.
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()