pub struct WriterTurtleSerializer<W: Write> { /* private fields */ }
Expand description
Writes a Turtle file to a Write
implementation.
Can be built using TurtleSerializer::for_writer
.
use oxrdf::vocab::rdf;
use oxrdf::{NamedNodeRef, TripleRef};
use oxttl::TurtleSerializer;
let mut serializer = TurtleSerializer::new()
.with_prefix("schema", "http://schema.org/")?
.for_writer(Vec::new());
serializer.serialize_triple(TripleRef::new(
NamedNodeRef::new("http://example.com#me")?,
rdf::TYPE,
NamedNodeRef::new("http://schema.org/Person")?,
))?;
assert_eq!(
b"@prefix schema: <http://schema.org/> .\n<http://example.com#me> a schema:Person .\n",
serializer.finish()?.as_slice()
);
Implementations§
Auto Trait Implementations§
impl<W> Freeze for WriterTurtleSerializer<W>where
W: Freeze,
impl<W> RefUnwindSafe for WriterTurtleSerializer<W>where
W: RefUnwindSafe,
impl<W> Send for WriterTurtleSerializer<W>where
W: Send,
impl<W> Sync for WriterTurtleSerializer<W>where
W: Sync,
impl<W> Unpin for WriterTurtleSerializer<W>where
W: Unpin,
impl<W> UnwindSafe for WriterTurtleSerializer<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