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