Skip to content
This repository was archived by the owner on Oct 6, 2020. It is now read-only.

Commit 2e15800

Browse files
authored
Merge pull request #27 from MindFlavor/cosmos
Replaced tuple return values with single structs
2 parents 9e25125 + 6052510 commit 2e15800

24 files changed

+193
-162
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## [0.4.3](https://github.com/MindFlavor/AzureSDKForRust/releases/tag/0.4.3) (2017-07-07)
2+
3+
**Breaking changes:**
4+
5+
* Changed return type from tuple to single struct to make methods more ergonomic. Issue [https://github.com/MindFlavor/AzureSDKForRust/issues/26](https://github.com/MindFlavor/AzureSDKForRust/issues/26).
6+
17
## [0.4.2](https://github.com/MindFlavor/AzureSDKForRust/releases/tag/0.4.2) (2017-07-05)
28

39
**Bugfix:**

Cargo.lock

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "azure_sdk_for_rust"
3-
version = "0.4.2"
3+
version = "0.4.3"
44
description = "Rust wrappers around Microsoft Azure REST APIs"
55
readme = "README.md"
66
authors = ["Francesco Cogno <francesco.cogno@outlook.com>", "Dong Liu <doliu@microsoft.com>"]
@@ -31,7 +31,7 @@ rust-crypto = "0.2.36"
3131
serde = "1.0.9"
3232
serde_derive = "1.0.9"
3333
serde_json = "1.0.2"
34-
time = "0.1.37"
34+
time = "0.1.38"
3535
tokio = "0.0.0"
3636
tokio-core = "0.1.8"
3737
url = "1.5.1"

README.md

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,14 @@
44

55
[![Crate](https://img.shields.io/crates/v/azure_sdk_for_rust.svg)](https://crates.io/crates/azure_sdk_for_rust) [![legal](https://img.shields.io/crates/l/azure_sdk_for_rust.svg)](LICENSE) [![cratedown](https://img.shields.io/crates/d/azure_sdk_for_rust.svg)](https://crates.io/crates/azure_sdk_for_rust) [![cratelastdown](https://img.shields.io/crates/dv/azure_sdk_for_rust.svg)](https://crates.io/crates/azure_sdk_for_rust)
66

7-
[![tag](https://img.shields.io/github/tag/mindflavor/AzureSDKForRust.svg)](https://github.com/MindFlavor/AzureSDKForRust/tree/0.4.2)
8-
[![release](https://img.shields.io/github/release/mindflavor/AzureSDKForRust.svg)](https://github.com/MindFlavor/AzureSDKForRust/tree/0.4.2)
9-
[![commitssince](https://img.shields.io/github/commits-since/mindflavor/AzureSDKForRust/0.4.2.svg)](https://img.shields.io/github/commits-since/mindflavor/AzureSDKForRust/0.4.2.svg)
7+
[![tag](https://img.shields.io/github/tag/mindflavor/AzureSDKForRust.svg)](https://github.com/MindFlavor/AzureSDKForRust/tree/0.4.3)
8+
[![release](https://img.shields.io/github/release/mindflavor/AzureSDKForRust.svg)](https://github.com/MindFlavor/AzureSDKForRust/tree/0.4.3)
9+
[![commitssince](https://img.shields.io/github/commits-since/mindflavor/AzureSDKForRust/0.4.3.svg)](https://img.shields.io/github/commits-since/mindflavor/AzureSDKForRust/0.4.3.svg)
1010

1111
## Introduction
1212
Microsoft Azure expose its technologies via REST API. These APIs are easily consumable from any language (good) but are weakly typed. With this library and its related [crate](https://crates.io/crates/azure_sdk_for_rust/) you can exploit the power of Microsoft Azure from Rust in a idiomatic way.
1313

14-
This crate relies heavily on the excellent crate called [Hyper](https://github.com/hyperium/hyper). As of this library version [0.4.2](https://github.com/MindFlavor/AzureSDKForRust/releases/tag/0.4.2) all the methods are future-aware. That is, I'm using the latest Hyper code.
15-
16-
Rust, however, still requires you to Box every future returned by a method. The alternative is to use the ```impl Trait``` feature which is nightly-only. Since I've used it everywhere this library will require a nightly Rust compiler until the ```impl Trait``` makes its way to the stable channel. Also since I'm using an unstable feature these is a very good chance of this code to break in the future.
14+
This crate relies heavily on the excellent crate called [Hyper](https://github.com/hyperium/hyper). As of this library version [0.4.0](https://github.com/MindFlavor/AzureSDKForRust/releases/tag/0.4.0) all the methods are future-aware. Rust, however, still requires you to Box every future returned by a method. The alternative is to use the ```impl Trait``` feature which is nightly-only. Since I've used it everywhere this library __will require a nightly Rust compiler__ until the ```impl Trait``` makes its way to the stable channel. Also since I'm using an unstable feature these is a very good chance of this code to break in the future.
1715

1816
> **NOTE:** This repository is under heavy development and
1917
is likely to break over time. The current releases will probabily contain bugs. As usual open issues if you find any.
@@ -22,7 +20,7 @@ is likely to break over time. The current releases will probabily contain bugs.
2220
Although I am a Microsoft employee, this is not a Microsoft endorsed project. It's simply a pet project of mine: I love Rust (who doesn't? :smirk:) and Microsoft Azure technologies so I thought to close the gap between them. It's also a good project for learning Rust. This library relies heavily on [Hyper](https://github.com/hyperium/hyper). We use the latest Hyper code so this library is fully async with Futures and Tokio.
2321

2422
## Example
25-
You can find examples in the [```examples```](https://github.com/MindFlavor/AzureSDKForRust/tree/master/examples) folder. Here is a sample however:
23+
You can find examples in the [```examples```](https://github.com/MindFlavor/AzureSDKForRust/tree/master/examples) folder. Here is a glimpse:
2624

2725
### main.rs
2826

@@ -258,7 +256,10 @@ If you want to contribute please do! No formality required! :wink:. Please note
258256

259257
Azure tables entities can be manipulated in batches. The entities are serialized in ```JSON```.
260258

261-
## Run E2E test (in progress)
259+
## Run E2E test
260+
261+
### Linux
262+
262263
```bash
263264
export STORAGE_ACCOUNT=<account>
264265
export STORAGE_MASTER_KEY=<key>
@@ -271,5 +272,19 @@ export AZURE_POLICY_KEY=<azure policy key>
271272
cargo test --features=test_e2e
272273
```
273274

275+
### Windows
276+
277+
```bat
278+
set STORAGE_ACCOUNT=<account>
279+
set STORAGE_MASTER_KEY=<key>
280+
281+
set AZURE_SERVICE_BUS_NAMESPACE=<azure_service_bus_namespace>
282+
set AZURE_EVENT_HUB_NAME=<azure_event_hub_name>
283+
set AZURE_POLICY_NAME=<azure_policy_name>
284+
set AZURE_POLICY_KEY=<azure policy key>
285+
286+
cargo test --features=test_e2e
287+
```
288+
274289
## License
275290
This project is published under [Apache license, version 2.0](LICENSE).

examples/blob00.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ fn main() {
2424
// A series of unwrap(), unwrap() would have achieved the same result.
2525
fn code() -> Result<(), Box<Error>> {
2626
// First we retrieve the account name and master key from environment variables.
27-
let account = std::env::var("STORAGE_ACCOUNT")
28-
.expect("Set env variable STORAGE_ACCOUNT first!");
29-
let master_key = std::env::var("STORAGE_MASTER_KEY")
30-
.expect("Set env variable STORAGE_MASTER_KEY first!");
27+
let account =
28+
std::env::var("STORAGE_ACCOUNT").expect("Set env variable STORAGE_ACCOUNT first!");
29+
let master_key =
30+
std::env::var("STORAGE_MASTER_KEY").expect("Set env variable STORAGE_MASTER_KEY first!");
3131

3232
let container = std::env::args()
3333
.nth(1)

examples/collection.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ fn main() {
2525
fn code() -> Result<(), Box<Error>> {
2626
// First we retrieve the account name and master key from environment variables.
2727
// We expect master keys (ie, not resource constrained)
28-
let master_key = std::env::var("COSMOS_MASTER_KEY")
29-
.expect("Set env variable COSMOS_MASTER_KEY first!");
28+
let master_key =
29+
std::env::var("COSMOS_MASTER_KEY").expect("Set env variable COSMOS_MASTER_KEY first!");
3030
let account = std::env::var("COSMOS_ACCOUNT").expect("Set env variable COSMOS_ACCOUNT first!");
3131

3232
// let's create a tokio-core reactor.

examples/container00.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ fn main() {
2626
// A series of unwrap(), unwrap() would have achieved the same result.
2727
fn code() -> Result<(), Box<Error>> {
2828
// First we retrieve the account name and master key from environment variables.
29-
let account = std::env::var("STORAGE_ACCOUNT")
30-
.expect("Set env variable STORAGE_ACCOUNT first!");
31-
let master_key = std::env::var("STORAGE_MASTER_KEY")
32-
.expect("Set env variable STORAGE_MASTER_KEY first!");
29+
let account =
30+
std::env::var("STORAGE_ACCOUNT").expect("Set env variable STORAGE_ACCOUNT first!");
31+
let master_key =
32+
std::env::var("STORAGE_MASTER_KEY").expect("Set env variable STORAGE_MASTER_KEY first!");
3333

3434
let mut core = Core::new()?;
3535

examples/create_delete_database.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ fn main() {
2525
fn code() -> Result<(), Box<Error>> {
2626
// First we retrieve the account name and master key from environment variables.
2727
// We expect master keys (ie, not resource constrained)
28-
let master_key = std::env::var("COSMOS_MASTER_KEY")
29-
.expect("Set env variable COSMOS_MASTER_KEY first!");
28+
let master_key =
29+
std::env::var("COSMOS_MASTER_KEY").expect("Set env variable COSMOS_MASTER_KEY first!");
3030
let account = std::env::var("COSMOS_ACCOUNT").expect("Set env variable COSMOS_ACCOUNT first!");
3131

3232
// let's create a tokio-core reactor.

examples/document00.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ fn main() {
4848
fn code() -> Result<(), Box<Error>> {
4949
// Let's get Cosmos account and master key from env variables.
5050
// This helps automated testing.
51-
let master_key = std::env::var("COSMOS_MASTER_KEY")
52-
.expect("Set env variable COSMOS_MASTER_KEY first!");
51+
let master_key =
52+
std::env::var("COSMOS_MASTER_KEY").expect("Set env variable COSMOS_MASTER_KEY first!");
5353
let account = std::env::var("COSMOS_ACCOUNT").expect("Set env variable COSMOS_ACCOUNT first!");
5454

5555
// First, we create an authorization token. There are two types of tokens, master and resource

0 commit comments

Comments
 (0)