[−][src]Struct rio_turtle::TriGFormatter
A TriG formatter.
It implements the QuadsFormatter
trait.
Write some triples using the QuadsFormatter
API into a Vec
buffer:
use rio_turtle::TriGFormatter; use rio_api::formatter::QuadsFormatter; use rio_api::model::{NamedNode, Triple, Quad}; let mut formatter = TriGFormatter::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()) }).unwrap(); let trig = formatter.finish().unwrap();
Methods
impl<W: Write> TriGFormatter<W>
[src]
pub fn new(write: W) -> Self
[src]
Builds a new formatter from a Write
implementation
pub fn finish(self) -> Result<W, Error>
[src]
Finishes to write and returns the underlying Write
Trait Implementations
impl<W: Write> QuadsFormatter for TriGFormatter<W>
[src]
Auto Trait Implementations
impl<W> RefUnwindSafe for TriGFormatter<W> where
W: RefUnwindSafe,
W: RefUnwindSafe,
impl<W> Send for TriGFormatter<W> where
W: Send,
W: Send,
impl<W> Sync for TriGFormatter<W> where
W: Sync,
W: Sync,
impl<W> Unpin for TriGFormatter<W> where
W: Unpin,
W: Unpin,
impl<W> UnwindSafe for TriGFormatter<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,
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.
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>,