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

Commit c8b5230

Browse files
author
Francesco Cogno
authored
CosmosDB: client traits Sync + Send (#295)
* Added Send + Sync to client traits * Updated README
1 parent a6e96ba commit c8b5230

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
[![Build Status](https://travis-ci.org/MindFlavor/AzureSDKForRust.svg?branch=master)](https://travis-ci.org/MindFlavor/AzureSDKForRust) [![Coverage Status](https://coveralls.io/repos/MindFlavor/AzureSDKForRust/badge.svg?branch=master&service=github)](https://coveralls.io/github/MindFlavor/AzureSDKForRust?branch=master) ![stability-unstable](https://img.shields.io/badge/stability-unstable-yellow.svg)
77

8-
[![tag](https://img.shields.io/github/tag/mindflavor/AzureSDKForRust.svg)](https://github.com/MindFlavor/AzureSDKForRust/tree/storage_core_0.44.1) [![release](https://img.shields.io/github/release/mindflavor/AzureSDKForRust.svg)](https://github.com/MindFlavor/AzureSDKForRust/releases/tag/storage_core_0.44.1) [![commitssince](https://img.shields.io/github/commits-since/mindflavor/AzureSDKForRust/storage_core_0.44.1)](https://github.com/MindFlavor/AzureSDKForRust/commits/master)
8+
[![tag](https://img.shields.io/github/tag/mindflavor/AzureSDKForRust.svg)](https://github.com/MindFlavor/AzureSDKForRust/tree/cosmos_0.100.2) [![release](https://img.shields.io/github/release/mindflavor/AzureSDKForRust.svg)](https://github.com/MindFlavor/AzureSDKForRust/releases/tag/cosmos_0.100.2) [![commitssince](https://img.shields.io/github/commits-since/mindflavor/AzureSDKForRust/cosmos_0.100.2)](https://github.com/MindFlavor/AzureSDKForRust/commits/master)
99

1010
[![GitHub contributors](https://img.shields.io/github/contributors/MindFlavor/AzureSDKForRust.svg)](https://github.com/MindFlavor/AzureSDKForRust/graphs/contributors)
1111

azure_sdk_cosmos/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_cosmos"
3-
version = "0.100.1"
3+
version = "0.100.2"
44
description = "Rust wrappers around Microsoft Azure REST APIs - Azure Cosmos DB crate"
55
readme = "README.md"
66
authors = ["Francesco Cogno <francesco.cogno@outlook.com>", "Max Gortman <mgortman@microsoft.com>"]
@@ -15,7 +15,7 @@ categories = ["api-bindings"]
1515
edition = "2018"
1616

1717
[dependencies]
18-
azure_sdk_core = { path = "../azure_sdk_core", version = "0.43.3" }
18+
azure_sdk_core = { path = "../azure_sdk_core", version = "0.43.4" }
1919
ring = "0.16"
2020
base64 = "0.12"
2121
chrono = "0.4"

azure_sdk_cosmos/src/clients/cosmos_struct.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const AZURE_VERSION: &str = "2018-12-31";
2424
const VERSION: &str = "1.0";
2525
const TIME_FORMAT: &str = "%a, %d %h %Y %T GMT";
2626

27-
pub trait CosmosUriBuilder {
27+
pub trait CosmosUriBuilder: Send + Sync {
2828
fn build_base_uri(&self) -> &str;
2929
}
3030

azure_sdk_cosmos/src/traits.rs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ use hyper_rustls::HttpsConnector;
66
use std::borrow::Cow;
77
use std::fmt::Debug;
88

9-
pub trait HasHyperClient: Debug {
9+
pub trait HasHyperClient: Debug + Send + Sync {
1010
fn hyper_client(&self) -> &hyper::Client<HttpsConnector<hyper::client::HttpConnector>>;
1111
}
1212

13-
pub trait CosmosClient: HasHyperClient {
13+
pub trait CosmosClient: HasHyperClient + Send + Sync {
1414
fn create_database(&self) -> requests::CreateDatabaseBuilder<'_, No>;
1515
fn list_databases(&self) -> requests::ListDatabasesBuilder<'_>;
1616

@@ -62,7 +62,7 @@ where
6262
fn database_client(&self) -> &D;
6363
}
6464

65-
pub trait WithDatabaseClient<'a, C, D>: Debug
65+
pub trait WithDatabaseClient<'a, C, D>: Debug + Send + Sync
6666
where
6767
C: CosmosClient,
6868
D: DatabaseClient<C>,
@@ -72,7 +72,7 @@ where
7272
IntoCowStr: Into<Cow<'a, str>>;
7373
}
7474

75-
pub trait IntoDatabaseClient<'a, C, D>: Debug
75+
pub trait IntoDatabaseClient<'a, C, D>: Debug + Send + Sync
7676
where
7777
C: CosmosClient,
7878
D: DatabaseClient<C>,
@@ -125,7 +125,7 @@ where
125125
fn user_client(&self) -> &USER;
126126
}
127127

128-
pub trait WithUserClient<'a, C, D, USER>: Debug
128+
pub trait WithUserClient<'a, C, D, USER>: Debug + Send + Sync
129129
where
130130
C: CosmosClient,
131131
D: DatabaseClient<C>,
@@ -136,7 +136,7 @@ where
136136
IntoCowStr: Into<Cow<'a, str>>;
137137
}
138138

139-
pub trait IntoUserClient<'a, C, D, USER>: Debug
139+
pub trait IntoUserClient<'a, C, D, USER>: Debug + Send + Sync
140140
where
141141
C: CosmosClient,
142142
D: DatabaseClient<C>,
@@ -198,7 +198,7 @@ where
198198
fn permission_client(&self) -> &PERMISSION;
199199
}
200200

201-
pub trait WithPermissionClient<'a, C, D, USER, PERMISSION>: Debug
201+
pub trait WithPermissionClient<'a, C, D, USER, PERMISSION>: Debug + Send + Sync
202202
where
203203
C: CosmosClient,
204204
D: DatabaseClient<C>,
@@ -210,7 +210,7 @@ where
210210
IntoCowStr: Into<Cow<'a, str>>;
211211
}
212212

213-
pub trait IntoPermissionClient<'a, C, D, USER, PERMISSION>: Debug
213+
pub trait IntoPermissionClient<'a, C, D, USER, PERMISSION>: Debug + Send + Sync
214214
where
215215
C: CosmosClient,
216216
D: DatabaseClient<C>,
@@ -278,7 +278,7 @@ where
278278
fn collection_client(&self) -> &COLL;
279279
}
280280

281-
pub trait WithCollectionClient<'a, C, D, COLL>: Debug
281+
pub trait WithCollectionClient<'a, C, D, COLL>: Debug + Send + Sync
282282
where
283283
C: CosmosClient,
284284
D: DatabaseClient<C>,
@@ -289,7 +289,7 @@ where
289289
IntoCowStr: Into<Cow<'a, str>>;
290290
}
291291

292-
pub trait IntoCollectionClient<'a, C, D, COLL>: Debug
292+
pub trait IntoCollectionClient<'a, C, D, COLL>: Debug + Send + Sync
293293
where
294294
C: CosmosClient,
295295
D: DatabaseClient<C>,
@@ -356,7 +356,7 @@ where
356356
fn user_defined_function_client(&self) -> &UDF;
357357
}
358358

359-
pub trait WithUserDefinedFunctionClient<'a, C, D, COLL, UDF>: Debug
359+
pub trait WithUserDefinedFunctionClient<'a, C, D, COLL, UDF>: Debug + Send + Sync
360360
where
361361
C: CosmosClient,
362362
D: DatabaseClient<C>,
@@ -371,7 +371,7 @@ where
371371
IntoCowStr: Into<Cow<'a, str>>;
372372
}
373373

374-
pub trait IntoUserDefinedFunctionClient<'a, C, D, COLL, UDF>: Debug
374+
pub trait IntoUserDefinedFunctionClient<'a, C, D, COLL, UDF>: Debug + Send + Sync
375375
where
376376
C: CosmosClient,
377377
D: DatabaseClient<C>,
@@ -444,7 +444,7 @@ where
444444
fn stored_procedure_client(&self) -> &SP;
445445
}
446446

447-
pub trait WithStoredProcedureClient<'a, C, D, COLL, SP>: Debug
447+
pub trait WithStoredProcedureClient<'a, C, D, COLL, SP>: Debug + Send + Sync
448448
where
449449
C: CosmosClient,
450450
D: DatabaseClient<C>,
@@ -456,7 +456,7 @@ where
456456
IntoCowStr: Into<Cow<'a, str>>;
457457
}
458458

459-
pub trait IntoStoredProcedureClient<'a, C, D, COLL, SP>: Debug
459+
pub trait IntoStoredProcedureClient<'a, C, D, COLL, SP>: Debug + Send + Sync
460460
where
461461
C: CosmosClient,
462462
D: DatabaseClient<C>,
@@ -518,7 +518,7 @@ where
518518
fn trigger_client(&self) -> &TRIGGER;
519519
}
520520

521-
pub trait WithTriggerClient<'a, C, D, COLL, TRIGGER>: Debug
521+
pub trait WithTriggerClient<'a, C, D, COLL, TRIGGER>: Debug + Send + Sync
522522
where
523523
C: CosmosClient,
524524
D: DatabaseClient<C>,
@@ -530,7 +530,7 @@ where
530530
IntoCowStr: Into<Cow<'a, str>>;
531531
}
532532

533-
pub trait IntoTriggerClient<'a, C, D, COLL, TRIGGER>: Debug
533+
pub trait IntoTriggerClient<'a, C, D, COLL, TRIGGER>: Debug + Send + Sync
534534
where
535535
C: CosmosClient,
536536
D: DatabaseClient<C>,
@@ -590,7 +590,7 @@ where
590590
fn document_client(&self) -> &DOC;
591591
}
592592

593-
pub trait WithDocumentClient<'a, 'b, C, D, COLL, DOC>: Debug
593+
pub trait WithDocumentClient<'a, 'b, C, D, COLL, DOC>: Debug + Send + Sync
594594
where
595595
C: CosmosClient,
596596
D: DatabaseClient<C>,
@@ -606,7 +606,7 @@ where
606606
DocName: Into<Cow<'b, str>>;
607607
}
608608

609-
pub trait IntoDocumentClient<'b, C, D, COLL, DOC>: Debug
609+
pub trait IntoDocumentClient<'b, C, D, COLL, DOC>: Debug + Send + Sync
610610
where
611611
C: CosmosClient,
612612
D: DatabaseClient<C>,
@@ -686,7 +686,7 @@ where
686686
fn attachment_client(&self) -> &ATT;
687687
}
688688

689-
pub trait WithAttachmentClient<'a, C, D, COLL, DOC, ATT>: Debug
689+
pub trait WithAttachmentClient<'a, C, D, COLL, DOC, ATT>: Debug + Send + Sync
690690
where
691691
C: CosmosClient,
692692
D: DatabaseClient<C>,
@@ -699,7 +699,7 @@ where
699699
IntoCowStr: Into<Cow<'a, str>>;
700700
}
701701

702-
pub trait IntoAttachmentClient<'a, C, D, COLL, DOC, ATT>: Debug
702+
pub trait IntoAttachmentClient<'a, C, D, COLL, DOC, ATT>: Debug + Send + Sync
703703
where
704704
C: CosmosClient,
705705
D: DatabaseClient<C>,

0 commit comments

Comments
 (0)