ScalarEncoder

Trait ScalarEncoder 

Source
pub trait ScalarEncoder {
    type Scalar;

    // Required methods
    fn encode_scalar_graph(graph: GraphNameRef<'_>) -> Self::Scalar;
    fn encode_scalar_null() -> Self::Scalar;
    fn encode_scalar_named_node(node: NamedNodeRef<'_>) -> Self::Scalar;
    fn encode_scalar_blank_node(node: BlankNodeRef<'_>) -> Self::Scalar;
    fn encode_scalar_literal(literal: LiteralRef<'_>) -> Self::Scalar;

    // Provided method
    fn encode_scalar_term(term: TermRef<'_>) -> Self::Scalar { ... }
}
Expand description

Is responsible for encoding RDF terms (or NULL) in a particular encoding.

Required Associated Types§

Required Methods§

Source

fn encode_scalar_graph(graph: GraphNameRef<'_>) -> Self::Scalar

Encodes a GraphNameRef as a scalar in a particular encoding.

Source

fn encode_scalar_null() -> Self::Scalar

Encodes NULL as a scalar in a particular encoding.

Source

fn encode_scalar_named_node(node: NamedNodeRef<'_>) -> Self::Scalar

Encodes a NamedNodeRef as a scalar in a particular encoding.

Source

fn encode_scalar_blank_node(node: BlankNodeRef<'_>) -> Self::Scalar

Encodes a BlankNodeRef as a scalar in a particular encoding.

Source

fn encode_scalar_literal(literal: LiteralRef<'_>) -> Self::Scalar

Encodes a LiteralRef as a scalar in a particular encoding.

Provided Methods§

Source

fn encode_scalar_term(term: TermRef<'_>) -> Self::Scalar

Encodes a TermRef as a scalar in a particular encoding.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§