Skip to main content

Extractor

Trait Extractor 

Source
pub trait Extractor {
    // Required method
    fn extract(&self, path: &str, blob_id: &str, bytes: &[u8]) -> FactSet;

    // Provided method
    fn env_tag(&self) -> u64 { ... }
}
Expand description

Turns one source blob into the nodes and edges derived from it.

Required Methods§

Source

fn extract(&self, path: &str, blob_id: &str, bytes: &[u8]) -> FactSet

Extract a FactSet from a blob’s path, git blob_id, and bytes.

Implementations must be deterministic: identical inputs must always produce an identical fact set.

Provided Methods§

Source

fn env_tag(&self) -> u64

Runtime inputs — beyond (path, bytes) — that change extraction output and so must be folded into the sync cache key: the installed OCR-model identity and any IngestConfig toggles that gate extraction. The default is the media-model tag alone; Registry additionally folds in its ingestion config so toggling content off re-extracts affected blobs instead of serving stale, content-bearing facts.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§