GithubHelp home page GithubHelp logo

Comments (2)

cuviper avatar cuviper commented on September 26, 2024 1

When would one actually use IntoDeserializer? This is the first I've heard of it.

from indexmap.

Mingun avatar Mingun commented on September 26, 2024 1

For example, at implementation of a new format and structure, the containing IndexMap and similar serde_json::Value -- i.e. the type describing all possible values of the format. For example, I implemented such type in the my serde-gff library and can use it with serde-transcode in the idiomatic way:

extern crate serde;
extern crate serde_json;
extern crate serde_gff;
extern crate serde_transcode;

use serde::Serialize;
use std::io::{Write, BufWriter};
use std::fs::File;

fn main() {
    let value: serde_gff::Value = ...;
    let writer = BufWriter::new(File::create("output.json").unwrap());

    let mut serializer = serde_json::Serializer::pretty(writer);
    serde_transcode::transcode(&mut value.into_deserializer(), &mut serializer).unwrap();
    serializer.into_inner().flush().unwrap();
}

But you not the first who for the first time hears about IntoDeserializer :). This piece really, is not really clear documented.

from indexmap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.