pub struct CompactSerializer { /* private fields */ }Expand description
Compact Turtle serializer.
Implementations§
Source§impl CompactSerializer
impl CompactSerializer
Sourcepub fn with_config(config: CompactConfig) -> Self
pub fn with_config(config: CompactConfig) -> Self
Create a serializer with the given configuration.
Sourcepub fn add_prefix(
&mut self,
prefix: impl Into<String>,
namespace: impl Into<String>,
)
pub fn add_prefix( &mut self, prefix: impl Into<String>, namespace: impl Into<String>, )
Register a prefix.
Sourcepub fn serialize(&self, triples: &[RdfTriple]) -> (String, SerializerStats)
pub fn serialize(&self, triples: &[RdfTriple]) -> (String, SerializerStats)
Serialize a set of triples to compact Turtle.
Sourcepub fn detect_list(
&self,
head: &str,
triples: &[RdfTriple],
) -> Option<Vec<RdfTerm>>
pub fn detect_list( &self, head: &str, triples: &[RdfTriple], ) -> Option<Vec<RdfTerm>>
Detect rdf:List chains starting from the given blank node.
Returns the ordered list of rdf:first values if the blank node is the
head of a well-formed list terminating with rdf:nil, or None otherwise.
Sourcepub fn format_collection(&self, items: &[RdfTerm]) -> String
pub fn format_collection(&self, items: &[RdfTerm]) -> String
Format an rdf:List collection in (...) syntax.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CompactSerializer
impl RefUnwindSafe for CompactSerializer
impl Send for CompactSerializer
impl Sync for CompactSerializer
impl Unpin for CompactSerializer
impl UnsafeUnpin for CompactSerializer
impl UnwindSafe for CompactSerializer
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more