Skip to content

Commit

Permalink
doc: improve feature flag documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
dnaka91 committed Jan 1, 2025
1 parent 3d5a4fb commit cc7646f
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 14 deletions.
44 changes: 31 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,30 @@ keywords = ["async", "obs", "obs-websocket", "remote-control", "tokio"]
include = ["examples/**/*", "tests/**/*", "src/**/*", "LICENSE", "README.md", "CHANGELOG.md"]

[package.metadata.docs.rs]
features = ["builder", "events", "tls"]
features = ["doc"]

[package.metadata.cargo_check_external_types]
allowed_external_types = [
"bitflags::iter::Iter", # TODO
"bitflags::iter::IterNames", # TODO
"bitflags::traits::Flags", # TODO
"rgb::RGBA8", # TODO
"semver::Comparator", # TODO
"semver::Version", # TODO
"serde::de::Deserialize", # TODO
"serde::de::DeserializeOwned", # TODO
"serde::ser::Serialize", # TODO
"serde_json::value::Value", # TODO
"time::duration::Duration", # TODO
"uuid::Uuid", # TODO
"bitflags::iter::Iter",
"bitflags::iter::IterNames",
"bitflags::traits::Flags",
"rgb::RGBA8",
"semver::Comparator",
"semver::Version",
"serde::de::Deserialize",
"serde::de::DeserializeOwned",
"serde::ser::Serialize",
"serde_json::value::Value",
"time::duration::Duration",
"uuid::Uuid",
]

[dependencies]
async-stream = { version = "0.3.6", optional = true }
base64 = "0.22.1"
bitflags = { version = "2.6.0", features = ["serde"] }
bon = { version = "3.3.2", optional = true }
document-features = { version = "0.2.10", optional = true }
futures-util = { version = "0.3.31", features = ["sink"] }
rgb = { version = "0.8.50", default-features = false }
semver = { version = "1.0.24", features = ["serde"] }
Expand All @@ -61,9 +62,26 @@ tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }

[features]
default = []
#! By default no features are enabled in this crate, making all of them opt-in by design.
test-integration = []
## The builder feature enables struct builders for all available requests as well as the connection
## configuration struct.
##
## This enables new APIs for constructing instances of the request structs with type-safe builders
## for convenience, instead of typical struct initialization. It is especially helpful for structs
## with many optional fields.
##
## For example, have a look at [`ConnectConfig::builder`](crate::client::ConnectConfig::builder).
builder = ["dep:bon"]
doc = ["builder", "events", "tls", "dep:document-features"]
## The event feature enables receiving of user interaction events from `obs-websocket`.
##
## This is not enabled by default, as it has a large impact on the compilation time. Enabling it is
## crucial for reacting to user interactions in OBS, but be warned about the noticable compliation
## time increase.
events = ["dep:async-stream"]
## The tls feature enables Transport Layer Security support for the connection to OBS, helpful when
## securing the connection to a remote instance.
tls = ["tokio-tungstenite/rustls-tls-webpki-roots"]

[[example]]
Expand Down
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
//!
//! You may notice that several functions are named differently from the original `obs-websocket`
//! documentation. To help you find the right functions, have a look at [`docs::mapping`].
//!
//! ## Feature flags
#![cfg_attr(feature = "doc", doc = document_features::document_features!())]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![warn(missing_docs, rust_2018_idioms, clippy::all)]

pub use self::client::Client;
Expand Down

0 comments on commit cc7646f

Please sign in to comment.