pub struct TokioAsyncWriterNTriplesSerializer<W: AsyncWrite + Unpin> { /* private fields */ }Available on crate feature
async-tokio only.Expand description
Writes a N-Triples file to a AsyncWrite implementation.
Can be built using NTriplesSerializer::for_tokio_async_writer.
use oxrdf::{NamedNodeRef, TripleRef};
use oxrdf::vocab::rdf;
use oxttl::NTriplesSerializer;
let mut serializer = NTriplesSerializer::new().for_tokio_async_writer(Vec::new());
serializer.serialize_triple(TripleRef::new(
NamedNodeRef::new("http://example.com#me")?,
rdf::TYPE,
NamedNodeRef::new("http://schema.org/Person")?
)).await?;
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§
Source§impl<W: AsyncWrite + Unpin> TokioAsyncWriterNTriplesSerializer<W>
impl<W: AsyncWrite + Unpin> TokioAsyncWriterNTriplesSerializer<W>
Auto Trait Implementations§
impl<W> Freeze for TokioAsyncWriterNTriplesSerializer<W>where
W: Freeze,
impl<W> RefUnwindSafe for TokioAsyncWriterNTriplesSerializer<W>where
W: RefUnwindSafe,
impl<W> Send for TokioAsyncWriterNTriplesSerializer<W>where
W: Send,
impl<W> Sync for TokioAsyncWriterNTriplesSerializer<W>where
W: Sync,
impl<W> Unpin for TokioAsyncWriterNTriplesSerializer<W>
impl<W> UnsafeUnpin for TokioAsyncWriterNTriplesSerializer<W>where
W: UnsafeUnpin,
impl<W> UnwindSafe for TokioAsyncWriterNTriplesSerializer<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