diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index ce16113..f50de3f 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -19,7 +19,7 @@ jobs: - uses: actions-rs/cargo@v1 with: command: doc - args: --package mpris-server --no-deps + args: --package mpris-server --features "unstable" --no-deps - name: Deploy uses: peaceiris/actions-gh-pages@v3 diff --git a/Cargo.toml b/Cargo.toml index 96ef241..0276617 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,6 +19,9 @@ futures-util = { version = "0.3", default-features = false, features = ["std"] } serde = "1.0" zbus = "3.14" +[features] +unstable = [] + [dev-dependencies] async-std = { version = "1.12", features = ["attributes", "unstable"] } static_assertions = "1.1" diff --git a/README.md b/README.md index 54dc59d..7e9058b 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,12 @@ This library supports all the following interfaces as defined in the specificati To implement these interfaces, this crate offers two flavors: you can either create your own struct and implement `RootInterface` and `PlayerInterface` (or with optional `TrackListInterface` and `PlaylistsInterface`), or you can use the ready-to-use `Player` struct. +## Optional Features + +| Feature | Description | Default | +| ---------- | -------------------------------------------- | ------- | +| `unstable` | Enables internal APIs and unstable features. | No | + ## Examples For more detailed examples, see also the [examples directory](https://github.com/SeaDve/mpris-server/tree/main/examples). diff --git a/src/local_server.rs b/src/local_server.rs index e0a39ca..6bb277f 100644 --- a/src/local_server.rs +++ b/src/local_server.rs @@ -603,6 +603,7 @@ where /// Returns a reference to the inner [`Connection`]. /// /// If you needed to call this, consider filing an issue. + #[cfg(feature = "unstable")] #[inline] pub fn connection(&self) -> &Connection { self.inner.connection() diff --git a/src/server.rs b/src/server.rs index c696b8d..c5b3a3a 100644 --- a/src/server.rs +++ b/src/server.rs @@ -411,6 +411,7 @@ where /// Returns a reference to the inner [`Connection`]. /// /// If you needed to call this, consider filing an issue. + #[cfg(feature = "unstable")] #[inline] pub fn connection(&self) -> &Connection { &self.connection