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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//! # xarf — XARF v4 parser, validator, and generator
//!
//! The [eXtended Abuse Reporting Format](https://xarf.org/) (XARF) is a JSON
//! schema for describing abuse incidents — spam, DDoS, phishing, compromised
//! infrastructure, copyright violations, and so on. This crate is a Rust
//! implementation of the v4 spec.
//!
//! ## Quick start
//!
//! ```rust,no_run
//! use xarf::{parse, Contact, ReportBuilder, create_evidence};
//! use serde_json::json;
//!
//! // Parse incoming JSON.
//! let result = parse(r#"{"xarf_version": "4.2.0", ... }"#).unwrap();
//! if result.errors.is_empty() {
//! println!("category = {}", result.report.unwrap().category.as_str());
//! }
//!
//! // Build a new report programmatically.
//! let evidence = create_evidence("text/plain", b"log line");
//! let result = ReportBuilder::new("messaging", "spam", "192.0.2.1")
//! .reporter(Contact::new("Acme", "abuse@acme.example", "acme.example"))
//! .sender(Contact::new("Acme", "abuse@acme.example", "acme.example"))
//! .extra("protocol", json!("smtp"))
//! .extra("smtp_from", json!("spam@bad.example"))
//! .add_evidence(evidence)
//! .build()
//! .unwrap();
//! ```
//!
//! ## Modules
//!
//! - [`model`] — the [`Report`], [`Contact`], [`Evidence`], and [`Category`]
//! types that make up the typed view.
//! - [`parser`] — [`parse`] and [`parse_value`] for ingesting JSON.
//! - [`generator`] — [`ReportBuilder`], [`create_report`], [`create_evidence`]
//! for emitting new reports.
//! - [`validator`] — schema validation primitives behind the higher-level
//! entry points.
//! - [`v3_compat`] — automatic XARF v3 → v4 conversion.
// ---------------------------------------------------------------------------
// Public re-exports — the convenience API.
// ---------------------------------------------------------------------------
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;