pub enum DocumentFormat {
Pdf,
Docx,
Epub,
Odt,
Ods,
Odp,
Xlsx,
Pptx,
Json,
Yaml,
Opaque,
}Expand description
A detected document format (the class of the field’s source bytes).
Variants§
A validated PDF (physical indicators).
Docx
An OPC package with a WordprocessingML officeDocument part.
Epub
An OCF container with an EPUB package document.
Odt
An ODF package with an OpenDocument text content part.
Ods
An ODF package with an OpenDocument spreadsheet content part.
Odp
An ODF package with an OpenDocument presentation content part.
Xlsx
An OPC package with a SpreadsheetML workbook part.
Pptx
An OPC package with a PresentationML presentation part.
Json
A structured JSON document (the whole source parses as exactly one JSON value). Not a package: the exact leaf is the whole source (Phase 21.5.1).
Yaml
A structured YAML document (the whole source parses as a bounded YAML stream whose every document root is a mapping or a sequence). Not a package: the exact leaf is the whole source (Phase 21.6.1).
Opaque
Anything else; preserved exactly by the opaque floor.
Implementations§
Source§impl DocumentFormat
impl DocumentFormat
Sourcepub const fn name(self) -> &'static str
pub const fn name(self) -> &'static str
Stable lower-case name (used in JSON and in the manifest provenance token).
Sourcepub const fn adapter(self) -> &'static str
pub const fn adapter(self) -> &'static str
The adapter that serves this format (the observation layer’s name for it).
Sourcepub const fn compiled(self) -> bool
pub const fn compiled(self) -> bool
Whether the adapter for this format is compiled into this build.
Sourcepub fn provenance_prefix(self) -> String
pub fn provenance_prefix(self) -> String
The machine-readable format=<name>; provenance prefix recorded at ingest.
Sourcepub fn from_provenance(provenance: &str) -> Option<DocumentFormat>
pub fn from_provenance(provenance: &str) -> Option<DocumentFormat>
Recover the recorded format from a field manifest’s provenance string.
Returns None for a manifest that does not carry the token (e.g. a field
written before this subphase); such a field still serves every native
selector, but common observations decline typed rather than guessing.