pub struct NTriplesFormatter<W: Write> { /* fields omitted */ }
Expand description

A Canonical N-Triples formatter.

It implements the TriplesFormatter trait.

Write some triples using the TriplesFormatter API into a Vec buffer:

use rio_turtle::NTriplesFormatter;
use rio_api::formatter::TriplesFormatter;
use rio_api::model::{NamedNode, Triple};

let mut formatter = NTriplesFormatter::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 _ntriples = formatter.finish();

Implementations

Builds a new formatter from a Write implementation

Finishes writing and returns the underlying Write

Trait Implementations

Writes a triple

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.