pub trait GroundingSource {
// Required methods
fn parser(&self) -> ParserIdentity;
fn capabilities(&self) -> Capabilities;
fn fingerprint(&self) -> Option<String>;
fn pages(&self) -> Vec<PageGeometry>;
fn elements(&self) -> Vec<GroundingElement>;
// Provided methods
fn spans(&self) -> Vec<GroundingSpan> { ... }
fn tables(&self) -> Vec<GroundingTable> { ... }
fn crop_ref(&self, _page: &str, _bbox: [i64; 4]) -> Option<String> { ... }
fn element_by_id(&self, id: &str) -> Option<GroundingElement> { ... }
}Expand description
Parser output as evidence: everything ethos-verify is allowed to know about a
document. Implementations must be deterministic — same underlying artifact, same
returned data, same order.
Required Methods§
Sourcefn parser(&self) -> ParserIdentity
fn parser(&self) -> ParserIdentity
Identity of the producing parser (+ adapter when foreign).
Sourcefn capabilities(&self) -> Capabilities
fn capabilities(&self) -> Capabilities
Capability declaration; drives explicit verification downgrades.
Sourcefn fingerprint(&self) -> Option<String>
fn fingerprint(&self) -> Option<String>
Document fingerprint when the source declares one (sha256:… for Ethos).
Sourcefn pages(&self) -> Vec<PageGeometry>
fn pages(&self) -> Vec<PageGeometry>
Page geometry, ascending page index.
Sourcefn elements(&self) -> Vec<GroundingElement>
fn elements(&self) -> Vec<GroundingElement>
Elements in the source’s canonical order.
Provided Methods§
Sourcefn spans(&self) -> Vec<GroundingSpan>
fn spans(&self) -> Vec<GroundingSpan>
Spans, when capability spans is true. Default: none.
Sourcefn tables(&self) -> Vec<GroundingTable>
fn tables(&self) -> Vec<GroundingTable>
Tables, when the source models them. Default: none (verification of
table_cell claims downgrades accordingly).
Sourcefn crop_ref(&self, _page: &str, _bbox: [i64; 4]) -> Option<String>
fn crop_ref(&self, _page: &str, _bbox: [i64; 4]) -> Option<String>
Stable crop reference for an evidence region, when crop_support is true.
The verify layer treats this as an opaque audit pointer; sources own how the
referenced crop artifact is generated and stored.
Sourcefn element_by_id(&self, id: &str) -> Option<GroundingElement>
fn element_by_id(&self, id: &str) -> Option<GroundingElement>
Element lookup by id. Default: linear scan over Self::elements.
Adapters may override this as a convenience API for direct callers. The
verifier builds its own deterministic per-run index from Self::elements
so duplicate handling and traversal order stay tied to the evidence list.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl GroundingSource for Document
Ethos output is itself just another grounding source (PRD §1.5): the verify layer sees Ethos through the same trait as any foreign parser.