Created
November 10, 2017 10:49
-
-
Save anonymous/5846e7de5bfdcd8946a2f7e0229d6044 to your computer and use it in GitHub Desktop.
Rust code shared from the playground
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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