simd_json::value::prelude::base

Trait 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.

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§

Source§

impl Writable for simd_json::owned::Value

Source§

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

Source§

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

Source§

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