pub struct NQuadsFormatter<W: Write> { /* private fields */ }
Expand description
A N-Quads formatter.
It implements the QuadsFormatter
trait.
Write some triples using the QuadsFormatter
API into a Vec
buffer:
use rio_turtle::NQuadsFormatter;
use rio_api::formatter::QuadsFormatter;
use rio_api::model::{NamedNode, Quad};
let mut formatter = NQuadsFormatter::new(Vec::default());
formatter.format(&Quad {
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(),
graph_name: Some(NamedNode { iri: "http://example.com/" }.into())
})?;
let _nquads = formatter.finish();
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<W> Freeze for NQuadsFormatter<W>where
W: Freeze,
impl<W> RefUnwindSafe for NQuadsFormatter<W>where
W: RefUnwindSafe,
impl<W> Send for NQuadsFormatter<W>where
W: Send,
impl<W> Sync for NQuadsFormatter<W>where
W: Sync,
impl<W> Unpin for NQuadsFormatter<W>where
W: Unpin,
impl<W> UnwindSafe for NQuadsFormatter<W>where
W: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more