use transistor::client::Crux;
use transistor::edn_rs::{ser_struct, Serialize};
use transistor::types::http::Action;
use transistor::types::CruxId;
fn main() {
let person1 = Person {
crux__db___id: CruxId::new("jorge-3"),
first_name: "Michael".to_string(),
last_name: "Jorge".to_string(),
};
let person2 = Person {
crux__db___id: CruxId::new("manuel-1"),
first_name: "Diego".to_string(),
last_name: "Manuel".to_string(),
};
println!("{:?}", person1.clone().serialize());
println!("{:?}", person2.clone().serialize());
let action1 = Action::Put(person1.serialize());
let action2 = Action::Put(person2.serialize());
let body = Crux::new("localhost", "3000")
.http_client()
.tx_log(vec![action1, action2])
.unwrap();
println!("\n Body = {:?}", body);
}
ser_struct! {
#[derive(Debug, Clone)]
#[allow(non_snake_case)]
pub struct Person {
crux__db___id: CruxId,
first_name: String,
last_name: String
}
}