1 unstable release
Uses old Rust 2015
0.1.0 | Jun 20, 2016 |
---|
#65 in #rest-client
8KB
116 lines
rust-hazelcast-rest
Client library to access Hazelcast Rest API
lib.rs
:
This library is a wrapper around Hazelcast Rest API. API includes methods to interact with distributed queues and maps only. User can offer elements to named queues and poll elements from them. User can also put elements to a map, remove elements one by one or remove all elements at once from a map.
#example
use hazelcast_rest::HazelcastRestClient;
let client = HazelcastRestClient::new("10.0.2.15", "5701");
client.queue_offer::<String>("sample_queue", "3".to_owned());
client.queue_offer::<String>("sample_queue", "4".to_owned());
assert_eq!(3, client.queue_delete("sample_queue", 10).unwrap().parse::<i32>().unwrap());
#example
use hazelcast_rest::HazelcastRestClient;
let client = HazelcastRestClient::new("10.0.2.15", "5701");
client.map_put::<String>("capital_map", "Turkey", "Ankara".to_owned());
client.map_put::<String>("capital_map", "France", "Paris".to_owned());
client.map_put::<String>("capital_map", "Turkey", "Istanbul".to_owned());
client.map_remove_all("capital_map");
assert_eq!("Ankara", client.map_get("capital_map", "Turkey").unwrap());
assert_eq!("Paris", client.map_get("capital_map", "France").unwrap());
Dependencies
~3–8.5MB
~71K SLoC