Struct rio_turtle::TurtleFormatter
source · [−]pub struct TurtleFormatter<W: Write> { /* private fields */ }
Expand description
A Turtle formatter.
It implements the TriplesFormatter
trait.
Write some triples using the TriplesFormatter
API into a Vec
buffer:
use rio_turtle::TurtleFormatter;
use rio_api::formatter::TriplesFormatter;
use rio_api::model::{NamedNode, Triple};
let mut formatter = TurtleFormatter::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 _turtle = formatter.finish()?;
Implementations
sourceimpl<W: Write> TurtleFormatter<W>
impl<W: Write> TurtleFormatter<W>
Trait Implementations
Auto Trait Implementations
impl<W> RefUnwindSafe for TurtleFormatter<W> where
W: RefUnwindSafe,
impl<W> Send for TurtleFormatter<W> where
W: Send,
impl<W> Sync for TurtleFormatter<W> where
W: Sync,
impl<W> Unpin for TurtleFormatter<W> where
W: Unpin,
impl<W> UnwindSafe for TurtleFormatter<W> where
W: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more