extern crate gob;
extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate serde_schema_derive;

use gob::StreamSerializer;
use serde_schema_derive::SchemaSerialize;

#[derive(Serialize, SchemaSerialize)]
struct Point {
    #[serde(rename = "X")]
    x: i64,
    #[serde(rename = "Y")]
    y: i64,
}

fn main() {
    let mut buffer = Vec::new();
    let mut stream = StreamSerializer::new_with_write(&mut buffer);
    stream.serialize(&Point { x: 22, y: 33 }).unwrap();
    println!("{:?}", buffer);
}
