Skip to content

Instantly share code, notes, and snippets.

Created November 10, 2017 10:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/5846e7de5bfdcd8946a2f7e0229d6044 to your computer and use it in GitHub Desktop.
Save anonymous/5846e7de5bfdcd8946a2f7e0229d6044 to your computer and use it in GitHub Desktop.
Rust code shared from the playground
fn main() {
let core = Core::new().unwrap();
println!("Trying to connect with server");
let client =
Client::<Objeto>::connect(&"0.0.0.0:4000".parse().unwrap(), &core.handle())
.wait()
.expect("Should have worked");
let objeto = Objeto {value: 1, network: None};
let id = client.post(None, &objeto).wait();
let new = client.get(id.unwrap()).wait().expect("Should have worked");
assert_eq!(objeto.value, new.value);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment