pub trait SRDFBuilder: SRDF {
// Required methods
fn empty() -> Self;
fn add_base(&mut self, base: &Option<IriS>) -> Result<(), Self::Err>;
fn add_prefix(&mut self, alias: &str, iri: &IriS) -> Result<(), Self::Err>;
fn add_prefix_map(&mut self, prefix_map: PrefixMap) -> Result<(), Self::Err>;
fn add_triple(
&mut self,
subj: &Self::Subject,
pred: &Self::IRI,
obj: &Self::Term,
) -> Result<(), Self::Err>;
fn remove_triple(
&mut self,
subj: &Self::Subject,
pred: &Self::IRI,
obj: &Self::Term,
) -> Result<(), Self::Err>;
fn add_type(
&mut self,
node: &RDFNode,
type_: Self::Term,
) -> Result<(), Self::Err>;
fn serialize<W: Write>(
&self,
format: &RDFFormat,
writer: &mut W,
) -> Result<(), Self::Err>;
}
Expand description
Types that implement this trait can build RDF data
Required Methods§
Sourcefn add_base(&mut self, base: &Option<IriS>) -> Result<(), Self::Err>
fn add_base(&mut self, base: &Option<IriS>) -> Result<(), Self::Err>
Adds an optional IRI as base
Sourcefn add_prefix(&mut self, alias: &str, iri: &IriS) -> Result<(), Self::Err>
fn add_prefix(&mut self, alias: &str, iri: &IriS) -> Result<(), Self::Err>
Adds a prefix declaration to the current RDF graph
Sourcefn add_prefix_map(&mut self, prefix_map: PrefixMap) -> Result<(), Self::Err>
fn add_prefix_map(&mut self, prefix_map: PrefixMap) -> Result<(), Self::Err>
Adds a prefix map declaration to the current RDF graph
Sourcefn add_triple(
&mut self,
subj: &Self::Subject,
pred: &Self::IRI,
obj: &Self::Term,
) -> Result<(), Self::Err>
fn add_triple( &mut self, subj: &Self::Subject, pred: &Self::IRI, obj: &Self::Term, ) -> Result<(), Self::Err>
Adds an RDF triple to the current RDF graph
Sourcefn remove_triple(
&mut self,
subj: &Self::Subject,
pred: &Self::IRI,
obj: &Self::Term,
) -> Result<(), Self::Err>
fn remove_triple( &mut self, subj: &Self::Subject, pred: &Self::IRI, obj: &Self::Term, ) -> Result<(), Self::Err>
Removes an RDf triple to the current RDF graph
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.