pub struct JsonLdSerializer { /* private fields */ }Expand description
JSON-LD serializer implementation
This wraps the full JSON-LD serializer from the jsonld module and provides a simplified interface for the format abstraction layer.
Implementations§
Source§impl JsonLdSerializer
impl JsonLdSerializer
Sourcepub fn with_profile(self, profile: JsonLdProfileSet) -> Self
pub fn with_profile(self, profile: JsonLdProfileSet) -> Self
Set the JSON-LD processing profile
Sourcepub fn with_prefix(
self,
prefix: impl Into<String>,
iri: impl Into<String>,
) -> Result<Self, RdfParseError>
pub fn with_prefix( self, prefix: impl Into<String>, iri: impl Into<String>, ) -> Result<Self, RdfParseError>
Add a prefix to the serializer
Sourcepub fn with_base_iri(
self,
base_iri: impl Into<String>,
) -> Result<Self, RdfParseError>
pub fn with_base_iri( self, base_iri: impl Into<String>, ) -> Result<Self, RdfParseError>
Set base IRI for generating relative IRIs
Sourcepub fn pretty(self) -> Self
pub fn pretty(self) -> Self
Enable pretty formatting (no-op for JSON-LD streaming serializer)
The underlying JSON-LD serializer always produces compact streaming output. This method is provided for API compatibility with other serializers.
Sourcepub fn for_writer<W: Write>(self, writer: W) -> WriterJsonLdSerializer<W>
pub fn for_writer<W: Write>(self, writer: W) -> WriterJsonLdSerializer<W>
Create a writer-based serializer
Sourcepub fn serialize_to_string(&self, quads: &[Quad]) -> SerializeResult<String>
pub fn serialize_to_string(&self, quads: &[Quad]) -> SerializeResult<String>
Serialize quads to a JSON-LD string
Sourcepub fn profile(&self) -> &JsonLdProfileSet
pub fn profile(&self) -> &JsonLdProfileSet
Get the processing profile
Trait Implementations§
Source§impl Clone for JsonLdSerializer
impl Clone for JsonLdSerializer
Source§fn clone(&self) -> JsonLdSerializer
fn clone(&self) -> JsonLdSerializer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for JsonLdSerializer
impl RefUnwindSafe for JsonLdSerializer
impl Send for JsonLdSerializer
impl Sync for JsonLdSerializer
impl Unpin for JsonLdSerializer
impl UnsafeUnpin for JsonLdSerializer
impl UnwindSafe for JsonLdSerializer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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