pub trait Stringifier {
    // Required method
    fn as_utf8(&self) -> &[u8] ;

    // Provided methods
    fn as_str(&self) -> &str { ... }
    fn to_string(&self) -> String { ... }
}
Expand description

A stringifier is special kind of TripleSerializer or QuadSerializer:

  • it uses a text-based format encoded in UTF8;
  • it stores the serialize data in memory;
  • it gives access to the serialized data as str or String.

Required Methods§

source

fn as_utf8(&self) -> &[u8]

Borrows the internal serialized data.

Note to implementers

It is the responsibility of implementors to ensure that this data is valid UTF8. The methods as_str and to_string rely on this.

Provided Methods§

source

fn as_str(&self) -> &str

Borrows the internal serialized data as a str.

source

fn to_string(&self) -> String

Copy the internal serialized data to a String.

Implementors§