Skip to main content

validate_citation

Function validate_citation 

Source
pub fn validate_citation(c: &Citation) -> Result<()>
Expand description

v0.7.0 Form 4 (issue #757) — validate a Citation envelope.

Required invariants:

  • uri is non-empty after trim and starts with one of the typed schemes accepted by validate_source_uri (mirror semantics — citation URIs and source URIs share the same form).
  • accessed_at parses as RFC3339.
  • hash (when present) is exactly 64 lowercase hex characters (SHA-256 digest).
  • span (when present) satisfies validate_source_span.

§Errors

Returns the first invariant failure encountered.