pub struct TurtleConfig { /* private fields */ }
Expand description
Turtle serializer configuration.
Implementations§
Source§impl TurtleConfig
impl TurtleConfig
Sourcepub fn pretty(&self) -> bool
pub fn pretty(&self) -> bool
Should the parser make extra effort to produce pretty Turtle.
If false (default), the triples will be serialized in streaming mode.
Subject and predicate “factorization” will only occur based on the previous triple(s)
in the stream. The collection syntax for rdf:List
s will not be used.
If true, extra effort will be made to group related triples together, and to use the collection syntax whenever possible. This requires storing the whole graph in memory.
Sourcepub fn prefix_map(&self) -> &[PrefixMapPair] ⓘ
pub fn prefix_map(&self) -> &[PrefixMapPair] ⓘ
Sourcepub fn indentation(&self) -> &str
pub fn indentation(&self) -> &str
Indentation to use in serialization.
(defaults to " "
, can only contain ASCII whitespaces)
NB: currently, only used if pretty
is true
.
Sourcepub fn new() -> Self
pub fn new() -> Self
Build a new default TurtleConfig
.
Sourcepub fn with_pretty(self, b: bool) -> Self
pub fn with_pretty(self, b: bool) -> Self
Transform a TurtleConfig
by setting the pretty
flag.
Sourcepub fn with_prefix_map<P: PrefixMap + ?Sized>(self, pm: &P) -> Self
pub fn with_prefix_map<P: PrefixMap + ?Sized>(self, pm: &P) -> Self
Transform a TurtleConfig
by setting the prefix_map
flag
(copying pm
using PrefixMap::to_vec
).
Sourcepub fn with_own_prefix_map(self, pm: Vec<PrefixMapPair>) -> Self
pub fn with_own_prefix_map(self, pm: Vec<PrefixMapPair>) -> Self
Transform a TurtleConfig
by setting the prefix_map
flag.
Sourcepub fn with_indentation<T: ToString>(self, indentation: T) -> Self
pub fn with_indentation<T: ToString>(self, indentation: T) -> Self
Transform a TurtleConfig
by setting the indentation
flag.
§Precondition
indentation
must only contain ASCII whitespaces, otherwise this method will panic.
Sourcepub fn default_prefix_map() -> Vec<PrefixMapPair> ⓘ
pub fn default_prefix_map() -> Vec<PrefixMapPair> ⓘ
Return the prefix map that is used when none is provided
Trait Implementations§
Source§impl Clone for TurtleConfig
impl Clone for TurtleConfig
Source§fn clone(&self) -> TurtleConfig
fn clone(&self) -> TurtleConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more