pub struct WriterNTriplesSerializer<W: Write> { /* private fields */ }
Expand description
Writes a N-Triples file to a Write
implementation.
Can be built using NTriplesSerializer::for_writer
.
use oxrdf::{NamedNodeRef, TripleRef};
use oxrdf::vocab::rdf;
use oxttl::NTriplesSerializer;
let mut serializer = NTriplesSerializer::new().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"<http://example.com#me> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person> .\n",
serializer.finish().as_slice()
);
Implementations§
Auto Trait Implementations§
impl<W> Freeze for WriterNTriplesSerializer<W>where
W: Freeze,
impl<W> RefUnwindSafe for WriterNTriplesSerializer<W>where
W: RefUnwindSafe,
impl<W> Send for WriterNTriplesSerializer<W>where
W: Send,
impl<W> Sync for WriterNTriplesSerializer<W>where
W: Sync,
impl<W> Unpin for WriterNTriplesSerializer<W>where
W: Unpin,
impl<W> UnwindSafe for WriterNTriplesSerializer<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