-
Notifications
You must be signed in to change notification settings - Fork 8
/
Cargo.toml
204 lines (159 loc) · 6.45 KB
/
Cargo.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
[package]
name = "pubnub"
version = "0.6.0"
edition = "2021"
license-file = "LICENSE"
authors = ["PubNub <[email protected]>"]
description = "PubNub SDK for Rust"
repository = "https://github.com/pubnub/rust"
documentation = "https://docs.rs/pubnub/latest/pubnub"
homepage = "https://www.pubnub.com"
categories = ["api-bindings", "asynchronous", "network-programming", "wasm"]
build = "build.rs"
[features]
# Enables all non-conflicting features
full = ["publish", "subscribe", "presence", "access", "serde", "reqwest", "crypto", "parse_token", "blocking", "std", "tokio"]
# Enables all default features
default = ["publish", "subscribe", "serde", "reqwest", "std", "blocking", "tokio"]
# [PubNub features]
## Enables publish feature
publish = []
## Enables access manager feature
access = []
## Enables crypto module
crypto = ["dep:aes", "dep:cbc", "getrandom"]
## Enables token parsing
parse_token = ["dep:ciborium"]
# [Implementation features]
## Enables serde implementation for serialization and deserialization
serde = ["dep:serde", "dep:serde_json", "hashbrown/serde"]
## Enables reqwest implementation for transport layer
reqwest = ["dep:reqwest", "dep:bytes"]
## Enables tokio runtime for subscribe loop
tokio = ["dep:tokio"]
## Enables blocking implementation for transport layer
blocking = ["reqwest?/blocking"]
## Enables std library
std = ["derive_builder/std", "log/std", "uuid/std", "base64/std", "spin/std", "snafu/std", "hmac/std", "sha2/std", "time/std", "bytes?/std", "getrandom/std", "rand/default", "serde?/std", "serde_json?/std", "ciborium?/std", "futures?/std", "futures?/async-await", "dep:async-channel"]
## Enables very specific implementations for different platforms.
##
## Use only if you know what you're doing.
##
## Using the portable_atomic crate allows for supporting platforms without native atomic operations.
## This is unsafe and enabling it for multicore systems is unsound.
## See the `portable_atomic` and `critical_section` crates docs for more information.
## https://docs.rs/portable_atomic
## and
## https://docs.rs/critical-section/latest/critical_section/
extra_platforms = ["spin/portable_atomic", "dep:portable-atomic"]
# [Internal features] (not intended for use outside of the library)
contract_test = ["parse_token", "publish", "access", "crypto", "std", "subscribe", "presence", "tokio"]
full_no_std = ["serde", "reqwest", "crypto", "parse_token", "blocking", "publish", "access", "subscribe", "tokio", "presence"]
full_no_std_platform_independent = ["serde", "crypto", "parse_token", "blocking", "publish", "access", "subscribe", "presence"]
pubnub_only = ["crypto", "parse_token", "blocking", "publish", "access", "subscribe", "presence"]
mock_getrandom = ["getrandom/custom"]
# TODO: temporary treated as internal until we officially release it
subscribe = ["dep:futures"]
presence = ["dep:futures"]
[dependencies]
async-trait = "0.1"
log = { version = "0.4", default-features = false }
hashbrown = "0.14.0"
spin = "0.9"
phantom-type = { version = "0.4.2", default-features = false }
percent-encoding = { version = "2.1", default-features = false }
base64 = { version = "0.21", features = ["alloc"], default-features = false }
derive_builder = { version = "0.12", default-features = false }
uuid = { version = "1.3", features = ["v4"], default-features = false }
snafu = { version = "0.7", features = ["rust_1_46"], default-features = false }
rand = { version = "0.8.5", default-features = false }
# signature
hmac = "0.12"
sha2 = {version = "0.10", default-features = false }
time = { version = "0.3", features = ["alloc"], default-features = false }
# serde
serde = { version = "1.0", features = ["derive"], optional = true, default-features = false }
serde_json = { version = "1.0", optional = true, features = ["alloc"] ,default-features = false }
# reqwest
reqwest = { version = "0.11", optional = true }
bytes = { version = "1.4", default-features = false, optional = true }
# crypto
aes = { version = "0.8.2", optional = true }
cbc = { version = "0.1.2", optional = true }
getrandom = { version = "0.2", optional = true }
# parse_token
ciborium = { version = "0.2.1", default-features = false, optional = true }
# subscribe, presence
futures = { version = "0.3.28", default-features = false, optional = true }
tokio = { version = "1", optional = true, features = ["rt-multi-thread", "macros", "time"] }
async-channel = { version = "1.8", optional = true }
# extra_platforms
portable-atomic = { version = "1.3", optional = true, default-features = false, features = ["require-cas", "critical-section"] }
[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { version = "0.2", features = ["js"] }
[dev-dependencies]
async-trait = "0.1"
tokio = { version = "1", features = ["rt-multi-thread", "macros", "time"] }
wiremock = "0.5"
env_logger = "0.10"
cucumber = { version = "0.20.2", features = ["output-junit"] }
reqwest = { version = "0.11", features = ["json"] }
test-case = "3.0"
hashbrown = { version = "0.14.0", features = ["serde"] }
getrandom = { version = "0.2", features = ["custom"] }
[build-dependencies]
built = "0.6"
[package.metadata.docs.rs]
all-features = true
[[test]]
name = "contract_test"
harness = false
required-features = ["contract_test"]
[[example]]
name = "crypto"
required-features = ["default", "crypto"]
[[example]]
name = "publish"
required-features = ["default"]
[[example]]
name = "publish_blocking"
required-features = ["default", "blocking"]
[[example]]
name = "pam"
required-features = ["default", "parse_token", "access"]
[[example]]
name = "pam_blocking"
required-features = ["default", "blocking", "access"]
[[example]]
name = "custom_origin"
required-features = ["default"]
[[example]]
name = "subscribe"
required-features = ["default", "subscribe"]
[[example]]
name = "subscribe_with_presence_state"
required-features = ["default", "subscribe", "presence"]
[[example]]
name = "subscribe_raw"
required-features = ["default", "subscribe"]
[[example]]
name = "subscribe_raw_blocking"
required-features = ["default", "subscribe"]
[[example]]
name = "here_now"
required-features = ["default", "presence"]
[[example]]
name = "here_now_blocking"
required-features = ["default", "blocking", "presence"]
[[example]]
name = "where_now"
required-features = ["default", "presence"]
[[example]]
name = "where_now_blocking"
required-features = ["default", "blocking", "presence"]
[[example]]
name = "presence_state"
required-features = ["default", "presence"]
[[example]]
name = "presence_state_blocking"
required-features = ["default", "blocking", "presence"]