1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright 2026 khive contributors. Licensed under Apache-2.0.
//
//! The `FormatAdapter` trait (ADR-036 §Implementation §Crate structure).
//!
//! Adapters are stateful pure transforms: they hold streaming parser state and
//! produce [`EntityRecord`]/[`EdgeRecord`] streams. They have no dependency on
//! the database layer.
use crateAdapterError;
use crate;
/// A format adapter (ADR-036 §Implementation).
///
/// Implementations parse a source format and yield entity and edge records
/// following the ADR-020 §2 field shapes. The adapter writes no database
/// state — its output is consumed by the standard `khive kg import` pipeline.
///
/// Both iterators return `Result<_, AdapterError>`. A fatal error (e.g. a
/// missing required field) stops the iterator; non-fatal warnings accumulate
/// internally and are retrievable via [`FormatAdapter::warnings`].