[package] name = "pubnub" version = "0.6.0" edition = "2021" license-file = "LICENSE" authors = ["PubNub "] 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"]