Struct rio_xml::RdfXmlFormatter [−][src]
A RDF XML formatter.
It implements the TriplesFormatter
trait.
Write some triples using the TriplesFormatter
API into a Vec
buffer:
use rio_xml::RdfXmlFormatter; use rio_api::formatter::TriplesFormatter; use rio_api::model::{NamedNode, Triple}; let mut formatter = RdfXmlFormatter::new(Vec::default())?; formatter.format(&Triple { subject: NamedNode { iri: "http://example.com/foo" }.into(), predicate: NamedNode { iri: "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" }.into(), object: NamedNode { iri: "http://schema.org/Person" }.into() })?; let _xml = formatter.finish()?;
Implementations
impl<W: Write> RdfXmlFormatter<W>
[src]
pub fn new(write: W) -> Result<Self, Error>
[src]
Builds a new formatter from a Write
implementation and starts writing
pub fn with_indentation(
write: W,
indentation_size: usize
) -> Result<Self, Error>
[src]
write: W,
indentation_size: usize
) -> Result<Self, Error>
Builds a new formatter from a Write
implementation and starts writing.
The output is indented with indentation_size
spaces.
pub fn finish(self) -> Result<W, Error>
[src]
Finishes writing and returns the underlying Write
Trait Implementations
impl<W: Write> TriplesFormatter for RdfXmlFormatter<W>
[src]
Auto Trait Implementations
impl<W> RefUnwindSafe for RdfXmlFormatter<W> where
W: RefUnwindSafe,
W: RefUnwindSafe,
impl<W> Send for RdfXmlFormatter<W> where
W: Send,
W: Send,
impl<W> Sync for RdfXmlFormatter<W> where
W: Sync,
W: Sync,
impl<W> Unpin for RdfXmlFormatter<W> where
W: Unpin,
W: Unpin,
impl<W> UnwindSafe for RdfXmlFormatter<W> where
W: UnwindSafe,
W: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,