Trait simd_json::value::prelude::Writable

source ·
pub trait Writable {
    // Required methods
    fn encode(&self) -> String;
    fn encode_pp(&self) -> String;
    fn write<'writer, W>(&self, w: &mut W) -> Result<(), Error>
       where W: 'writer + Write;
    fn write_pp<'writer, W>(&self, w: &mut W) -> Result<(), Error>
       where W: 'writer + Write;
}
Expand description

A Value that can be serialized and written

Required Methods§

source

fn encode(&self) -> String

Encodes the value into it’s JSON representation as a string

source

fn encode_pp(&self) -> String

Encodes the value into it’s JSON representation as a string (pretty printed)

source

fn write<'writer, W>(&self, w: &mut W) -> Result<(), Error>
where W: 'writer + Write,

Encodes the value into it’s JSON representation into a Writer

§Errors

Will return Err if an IO error is encountered

source

fn write_pp<'writer, W>(&self, w: &mut W) -> Result<(), Error>
where W: 'writer + Write,

Encodes the value into it’s JSON representation into a Writer, pretty printed

§Errors

Will return Err if an IO error is encountered.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Writable for simd_json::value::owned::Value

source§

impl<'tape, 'input> Writable for simd_json::value::tape::Value<'tape, 'input>

source§

impl<'value> Writable for simd_json::value::borrowed::Value<'value>