1717This is the official PubNub Rust SDK repository.
1818
1919[ PubNub] ( https://www.pubnub.com/ ) takes care of the infrastructure and APIs needed for the realtime
20- communication layer of your application. Work on your app's logic and let PubNub handle sending and receiving
21- data across the world in less than 100ms.
20+ communication layer of your application. Work on your app's logic and let
21+ PubNub handle sending and receiving data across the world in less than
22+ 100ms.
2223
2324## Getting started
2425
@@ -35,11 +36,11 @@ Add `pubnub` to your Rust project in the `Cargo.toml` file:
3536``` toml
3637# default features
3738[dependencies ]
38- pubnub = " 0.3 .0"
39+ pubnub = " 0.4 .0"
3940
4041# all features
4142[dependencies ]
42- pubnub = { version = " 0.3 .0" , features = [" full" ] }
43+ pubnub = { version = " 0.4 .0" , features = [" full" ] }
4344```
4445
4546### Example
@@ -125,24 +126,25 @@ You can find more examples in our [examples](https://github.com/pubnub/rust/tree
125126
126127## Features
127128
128- The ` pubnub ` crate is split into multiple features. You can enable or disable them in the ` Cargo.toml ` file, like so:
129+ The ` pubnub ` crate is split into multiple features. You can enable or
130+ disable them in the ` Cargo.toml ` file, like so:
129131
130132``` toml
131133# only blocking and access + default features
132134[dependencies ]
133- pubnub = { version = " 0.3 .0" , features = [" blocking" , " access" ] }
135+ pubnub = { version = " 0.4 .0" , features = [" blocking" , " access" ] }
134136
135137# only parse_token + default features
136138[dependencies ]
137- pubnub = { version = " 0.3 .0" , features = [" parse_token" ] }
139+ pubnub = { version = " 0.4 .0" , features = [" parse_token" ] }
138140```
139141
140142### Available features
141143
142144| Feature name | Description | Available PubNub APIs |
143145| :------------ | :---------- | :------------- |
144- | ` full ` | Enables all non-conflicting features | Configuration, Publish, Subscribe, Access Manager, Parse Token, Presence |
145- | ` default ` | Enables default features: ` publish ` , ` subscribe ` , ` serde ` , ` reqwest ` , ` aescbc ` , ` std ` | Configuration, Publish, Subscribe |
146+ | ` full ` | Enables all non-conflicting features | Configuration, Publish, Subscribe, Access Manager, Parse Token, Presence, Crypto Module |
147+ | ` default ` | Enables default features: ` publish ` , ` subscribe ` , ` serde ` , ` reqwest ` , ` std ` | Configuration, Publish, Subscribe |
146148| ` publish ` | Enables Publish API | Configuration, Publish |
147149| ` access ` | Enables Access Manager API | Configuration, Access Manager |
148150| ` parse_token ` | Enables parsing Access Manager tokens | Configuration, Parse Token |
@@ -152,7 +154,7 @@ pubnub = { version = "0.3.0", features = ["parse_token"] }
152154| ` serde ` | Uses [ serde] ( https://github.com/serde-rs/serde ) for serialization | n/a |
153155| ` reqwest ` | Uses [ reqwest] ( https://github.com/seanmonstar/reqwest ) as a transport layer | n/a |
154156| ` blocking ` | Enables blocking executions of APIs | n/a |
155- | ` aescbc ` | Enables AES-CBC encryption | n/a |
157+ | ` crypto ` | Enables crypto module for data encryption and decryption | n/a |
156158| ` std ` | Enables ` std ` library | n/a |
157159
158160## Documentation
@@ -162,52 +164,61 @@ pubnub = { version = "0.3.0", features = ["parse_token"] }
162164
163165## Wasm support
164166
165- The ` pubnub ` crate is compatible with WebAssembly. You can use it in your Wasm project.
167+ The ` pubnub ` crate is compatible with WebAssembly. You can use it in your
168+ Wasm project.
166169
167170## ` no_std ` support
168171
169- The ` pubnub ` crate is ` no_std ` compatible. To use it in a ` no_std ` environment, you have to disable the default
170- features and enable the ones you need, for example:
172+ The ` pubnub ` crate is ` no_std ` compatible. To use it in a ` no_std `
173+ environment, you have to disable the default features and enable the ones
174+ you need, for example:
171175
172176``` toml
173177[dependencies ]
174- pubnub = { version = " 0.3 .0" , default-features = false , features = [" serde" , " publish" ,
178+ pubnub = { version = " 0.4 .0" , default-features = false , features = [" serde" , " publish" ,
175179" blocking" ] }
176180```
177181
178182### Limitations
179183
180184The ` no_std ` support is limited by the implementation details of the SDK.
181185
182- The SDK uses the ` alloc ` crate to allocate memory for some operations, which means that
183- certain targets aren't supported. Additionally, as we provide a synchronous API, we use
184- some parts of the ` alloc::sync ` module, which is also not supported in certain ` no_std ` environments.
186+ The SDK uses the ` alloc ` crate to allocate memory for some operations, which
187+ means that certain targets aren't supported. Additionally, as we provide a
188+ synchronous API, we use some parts of the ` alloc::sync ` module, which is
189+ also not supported in certain ` no_std ` environments.
185190
186191Some SDK features aren't supported in a ` no_std ` environment:
187192
188193* partially ` access ` module (because of lack of timestamp support)
189- * partially ` reqwest ` transport (because of the reqwest implementation details)
190- * partially ` subscribe ` module (because of the spawning tasks and time dependence)
191- * partially ` presence ` module (because of the spawning tasks and time dependence)
194+ * partially ` reqwest ` transport (because of the reqwest implementation
195+ details)
196+ * partially ` subscribe ` module (because of the spawning tasks and time
197+ dependence)
198+ * partially ` presence ` module (because of the spawning tasks and time
199+ dependence)
192200* ` std ` feature (because of the ` std ` library)
193201
194- We depend on a random number generator to generate data for debugging purposes.
195- If you want to use the SDK in a ` no_std ` environment, you'll have to provide
196- your own random number generator implementation for certain targets.
202+ We depend on a random number generator to generate data for debugging
203+ purposes. If you want to use the SDK in a ` no_std ` environment, you'll have
204+ to provide your own random number generator implementation for certain
205+ targets.
197206
198207See more:
199208
200209* [ ` getrandom ` crate] ( https://docs.rs/getrandom/latest/getrandom/ )
201210* [ no_std examples] ( https://github.com/pubnub/rust/tree/master/examples/no_std/ )
202211
203- If you're having problems compiling this crate for more exotic targets, you can try to use the
204- ` extra_platforms ` feature. Be aware that this feature is ** not supported** and we do not recommend using it.
212+ If you're having problems compiling this crate for more exotic targets, you
213+ can try to use the ` extra_platforms ` feature. Be aware that this feature is
214+ ** not supported** and we do not recommend using it.
205215
206216For more information about this feature. refer to [ Cargo.toml] ( https://github.com/pubnub/rust/blob/master/Cargo.toml ) in the ` [features] ` section.
207217
208218## Support
209219
210- If you
** need help
** or have a
** general question
** , contact
[email protected] .
220+ If you ** need help** or have a ** general question** , contact
221+ 211222
212223## License
213224
0 commit comments