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

Commit 86de8e4

Browse files
authored
Merge pull request #38 from MindFlavor/develop
0.6.1
2 parents 9d0186c + d36c400 commit 86de8e4

File tree

11 files changed

+75
-69
lines changed

11 files changed

+75
-69
lines changed

Cargo.toml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "azure_sdk_for_rust"
3-
version = "0.6.0"
3+
version = "0.6.1"
44
description = "Rust wrappers around Microsoft Azure REST APIs"
55
readme = "README.md"
66
authors = ["Francesco Cogno <[email protected]>", "Dong Liu <[email protected]>"]
@@ -13,25 +13,25 @@ keywords = ["sdk", "azure", "rest", "iot", "cloud"]
1313
categories = ["api-bindings"]
1414

1515
[dependencies]
16-
RustyXML = "0.1.1"
17-
base64 = "0.7.0"
18-
chrono = "0.4.0"
19-
env_logger = "0.4.3"
20-
futures = "0.1.17"
21-
hyper = "0.11.6"
22-
hyper-tls = "0.1.2"
23-
log = "0.3.8"
24-
mime = "0.3.5"
25-
native-tls = "0.1.4"
26-
quick-error = "1.2.1"
27-
rust-crypto = "0.2.36"
28-
serde = "1.0.19"
29-
serde_derive = "1.0.19"
30-
serde_json = "1.0.6"
31-
time = "0.1.38"
32-
tokio-core = "0.1.10"
33-
url = "1.6.0"
34-
uuid = "0.5.1"
16+
RustyXML = "0.1.1"
17+
base64 = "0.9.1"
18+
chrono = "0.4.2"
19+
env_logger = "0.5.10"
20+
futures = "0.1.21"
21+
hyper = "0.11.26"
22+
hyper-tls = "0.1.3"
23+
log = "0.4.1"
24+
mime = "0.3.7"
25+
native-tls = "0.1.5"
26+
quick-error = "1.2.1"
27+
rust-crypto = "0.2.36"
28+
serde = "1.0.54"
29+
serde_derive = "1.0.54"
30+
serde_json = "1.0.17"
31+
time = "0.1.40"
32+
tokio-core = "0.1.17"
33+
url = "1.7.0"
34+
uuid = "0.6.3"
3535

3636
[features]
3737
test_e2e = []

examples/blob00.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ use std::error::Error;
1313
use futures::future::*;
1414
use tokio_core::reactor::Core;
1515

16-
use azure_sdk_for_rust::azure::storage::client::Client;
1716
use azure_sdk_for_rust::azure::storage::blob::Blob;
17+
use azure_sdk_for_rust::azure::storage::client::Client;
1818

1919
fn main() {
20-
env_logger::init().unwrap();
20+
env_logger::init();
2121
code().unwrap();
2222
}
2323

examples/blob01.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use azure_sdk_for_rust::azure::storage::blob::{Blob, BlobType, PUT_OPTIONS_DEFAU
2020
use azure_sdk_for_rust::azure::storage::client::Client;
2121

2222
fn main() {
23-
env_logger::init().unwrap();
23+
env_logger::init();
2424
code().unwrap();
2525
}
2626

examples/lease_blob.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ use std::error::Error;
1212
use futures::future::*;
1313
use tokio_core::reactor::Core;
1414

15-
use azure_sdk_for_rust::azure::storage::client::Client;
16-
use azure_sdk_for_rust::azure::storage::blob::{Blob, BlobType, LEASE_BLOB_OPTIONS_DEFAULT};
1715
use azure_sdk_for_rust::azure::core::lease::{LeaseAction, LeaseState, LeaseStatus};
16+
use azure_sdk_for_rust::azure::storage::blob::{Blob, BlobType, LEASE_BLOB_OPTIONS_DEFAULT};
17+
use azure_sdk_for_rust::azure::storage::client::Client;
1818

1919
use hyper::mime::Mime;
2020

2121
fn main() {
22-
env_logger::init().unwrap();
22+
env_logger::init();
2323
code().unwrap();
2424
}
2525

examples/put_blob.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ use std::error::Error;
1212
use futures::future::*;
1313
use tokio_core::reactor::Core;
1414

15-
use azure_sdk_for_rust::azure::storage::client::Client;
16-
use azure_sdk_for_rust::azure::storage::blob::{Blob, BlobType, LEASE_BLOB_OPTIONS_DEFAULT,
17-
LIST_BLOB_OPTIONS_DEFAULT, PUT_OPTIONS_DEFAULT};
1815
use azure_sdk_for_rust::azure::core::lease::{LeaseAction, LeaseState, LeaseStatus};
16+
use azure_sdk_for_rust::azure::storage::blob::{
17+
Blob, BlobType, LEASE_BLOB_OPTIONS_DEFAULT, LIST_BLOB_OPTIONS_DEFAULT, PUT_OPTIONS_DEFAULT,
18+
};
19+
use azure_sdk_for_rust::azure::storage::client::Client;
1920

2021
use azure_sdk_for_rust::azure::core::errors::AzureError;
2122

@@ -27,7 +28,7 @@ use hyper::mime::Mime;
2728
use std::io::Read;
2829

2930
fn main() {
30-
env_logger::init().unwrap();
31+
env_logger::init();
3132
code().unwrap();
3233
}
3334

@@ -110,7 +111,6 @@ fn code() -> Result<(), Box<Error>> {
110111

111112
core.run(future)?;
112113

113-
114114
println!("Leasing the blob...");
115115

116116
let mut lbo = LEASE_BLOB_OPTIONS_DEFAULT.clone();
@@ -125,17 +125,17 @@ fn code() -> Result<(), Box<Error>> {
125125
let lease_id = core.run(future)?;
126126
println!("lease id == {:?}", lease_id);
127127

128-
let future = Blob::list(&client, &container_name, &LIST_BLOB_OPTIONS_DEFAULT).map(
129-
|blobs| match blobs.iter().find(|blob| blob.name == name) {
128+
let future = Blob::list(&client, &container_name, &LIST_BLOB_OPTIONS_DEFAULT).map(|blobs| {
129+
match blobs.iter().find(|blob| blob.name == name) {
130130
Some(retrieved_blob) => {
131131
let sc = (*retrieved_blob).clone();
132132
Ok(sc)
133133
}
134134
None => Err(AzureError::GenericErrorWithText(
135135
"our blob should be here... where is it?".to_owned(),
136136
)),
137-
},
138-
);
137+
}
138+
});
139139

140140
let retrieved_blob = core.run(future)??;
141141
println!("retrieved_blob == {:?}", retrieved_blob);

src/azure/cosmos/client.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ use azure::cosmos::collection::Collection;
44
use azure::cosmos::database::Database;
55
use azure::cosmos::document::{DocumentAttributes, IndexingDirective};
66

7-
use azure::core::errors::{check_status_extract_body, check_status_extract_headers_and_body,
8-
extract_status_headers_and_body, AzureError, UnexpectedHTTPResult};
7+
use azure::core::errors::{
8+
check_status_extract_body, check_status_extract_headers_and_body,
9+
extract_status_headers_and_body, AzureError, UnexpectedHTTPResult,
10+
};
911

1012
use azure::core::COMPLETE_ENCODE_SET;
11-
use azure::cosmos::request_response::{CreateDatabaseRequest, Document,
12-
GetDocumentAdditionalHeaders, GetDocumentResponse,
13-
ListCollectionsResponse, ListDatabasesResponse,
14-
ListDocumentsResponse,
15-
ListDocumentsResponseAdditionalHeaders,
16-
ListDocumentsResponseAttributes,
17-
ListDocumentsResponseEntities, QueryDocumentResponse,
18-
QueryDocumentResponseAdditonalHeaders, QueryResponseMeta,
19-
QueryResult};
13+
use azure::cosmos::request_response::{
14+
CreateDatabaseRequest, Document, GetDocumentAdditionalHeaders, GetDocumentResponse,
15+
ListCollectionsResponse, ListDatabasesResponse, ListDocumentsResponse,
16+
ListDocumentsResponseAdditionalHeaders, ListDocumentsResponseAttributes,
17+
ListDocumentsResponseEntities, QueryDocumentResponse, QueryDocumentResponseAdditonalHeaders,
18+
QueryResponseMeta, QueryResult,
19+
};
2020

2121
use azure::core::incompletevector::ContinuationToken;
2222
use azure::cosmos::get_document::GetDocumentOptions;
@@ -847,13 +847,13 @@ impl<'a> Client {
847847
&self,
848848
database: S1,
849849
collection: S2,
850-
query: &Query<'b>,
850+
query: &Query,
851851
options: &QueryDocumentOptions,
852-
) -> impl Future<Item = QueryDocumentResponse<T>, Error = AzureError> + 'b
852+
) -> impl Future<Item = QueryDocumentResponse<T>, Error = AzureError>
853853
where
854-
T: DeserializeOwned + 'b,
855-
S1: AsRef<str> + 'b,
856-
S2: AsRef<str> + 'b,
854+
T: DeserializeOwned,
855+
S1: AsRef<str>,
856+
S2: AsRef<str>,
857857
{
858858
self.query_document_json(database, collection, query, options)
859859
.and_then(move |qdr_json| done(convert_query_document_type(qdr_json)))

src/azure/cosmos/collection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,4 @@ impl AsRef<str> for Collection {
125125
fn as_ref(&self) -> &str {
126126
&self.id
127127
}
128-
}
128+
}

src/azure/cosmos/database.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ impl AsRef<str> for Database {
2929
fn as_ref(&self) -> &str {
3030
&self.id
3131
}
32-
}
32+
}

src/azure/storage/blob/mod.rs

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ use azure::core::lease::{LeaseAction, LeaseDuration, LeaseId, LeaseState, LeaseS
2626
use azure::storage::client::Client;
2727
use hyper;
2828

29-
use azure::storage::rest_client::{ContentMD5, ETag, XMSClientRequestId, XMSLeaseAction,
30-
XMSLeaseBreakPeriod, XMSLeaseDuration, XMSLeaseDurationSeconds,
31-
XMSLeaseId, XMSLeaseState, XMSLeaseStatus, XMSProposedLeaseId,
32-
XMSRange, XMSRangeGetContentMD5};
29+
use azure::storage::rest_client::{
30+
ContentMD5, ETag, XMSClientRequestId, XMSLeaseAction, XMSLeaseBreakPeriod, XMSLeaseDuration,
31+
XMSLeaseDurationSeconds, XMSLeaseId, XMSLeaseState, XMSLeaseStatus, XMSProposedLeaseId,
32+
XMSRange, XMSRangeGetContentMD5,
33+
};
3334

3435
use azure::core::parsing::{cast_must, cast_optional, from_azure_time, traverse};
3536

@@ -39,8 +40,9 @@ use azure::core::enumerations;
3940
use std::fmt;
4041
use std::str::FromStr;
4142

42-
use azure::core::errors::{check_status_extract_body, check_status_extract_headers_and_body,
43-
AzureError, TraversingError};
43+
use azure::core::errors::{
44+
check_status_extract_body, check_status_extract_headers_and_body, AzureError, TraversingError,
45+
};
4446
use azure::core::parsing::FromStringOptional;
4547

4648
use azure::core::ba512_range::BA512Range;
@@ -51,8 +53,9 @@ use azure::core::range::Range;
5153

5254
use hyper::mime::Mime;
5355

54-
use hyper::header::{ContentEncoding, ContentLanguage, ContentLength, ContentType, Headers,
55-
LastModified};
56+
use hyper::header::{
57+
ContentEncoding, ContentLanguage, ContentLength, ContentType, Headers, LastModified,
58+
};
5659
use hyper::StatusCode;
5760

5861
use base64;
@@ -529,12 +532,12 @@ impl Blob {
529532
)
530533
}
531534

532-
pub fn put<'b>(
535+
pub fn put(
533536
&self,
534-
c: &'b Client,
535-
po: &'b PutOptions,
537+
c: &Client,
538+
po: &PutOptions,
536539
r: Option<&[u8]>,
537-
) -> impl Future<Item = (), Error = AzureError> + 'b {
540+
) -> impl Future<Item = (), Error = AzureError> {
538541
ok(self.put_create_request(c, po, r)).and_then(|req| {
539542
done(req)
540543
.from_err()

src/azure/storage/rest_client.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ use crypto::hmac::Hmac;
77
use crypto::mac::Mac;
88
use crypto::sha2::Sha256;
99
use hyper;
10-
use hyper::header::{ContentEncoding, ContentLanguage, ContentLength, ContentType, Date, Header,
11-
Headers, IfModifiedSince, IfUnmodifiedSince};
10+
use hyper::header::{
11+
ContentEncoding, ContentLanguage, ContentLength, ContentType, Date, Header, Headers,
12+
IfModifiedSince, IfUnmodifiedSince,
13+
};
1214
use hyper::Method;
1315
use hyper_tls;
1416
use std::fmt::Display;

0 commit comments

Comments
 (0)