swls_lang_rdf_base/triples.rs
1use std::fmt::Debug;
2
3use swls_core::prelude::MyQuad;
4
5/// Trait for extracting normalized RDF triples from a parsed language element.
6///
7/// Implement this on the parsed model (the shared `Turtle` type) to enable a
8/// generic derive-triples ECS system.
9/// The implementation must be in a crate that owns either this trait or the element type.
10pub trait IntoTriples {
11 type Error: Debug;
12 fn into_triples(&self) -> Result<Vec<MyQuad<'static>>, Self::Error>;
13}