rpc: add/doc feature flags

This commit is contained in:
hinto.janai 2024-07-01 20:52:57 -04:00
parent 6ce177aeca
commit 161eeb7be9
No known key found for this signature in database
GPG key ID: D47CE05FA175A499
3 changed files with 29 additions and 4 deletions

View file

@ -9,14 +9,19 @@ repository = "https://github.com/Cuprate/cuprate/tree/main/rpc/types"
keywords = ["cuprate", "rpc", "types", "monero"]
[features]
default = []
default = ["json", "bin", "other", "serde", "epee"]
json = []
bin = []
other = []
serde = ["dep:serde"]
epee = ["dep:cuprate-epee-encoding"]
[dependencies]
cuprate-epee-encoding = { path = "../../net/epee-encoding" }
cuprate-epee-encoding = { path = "../../net/epee-encoding", optional = true }
monero-serai = { workspace = true }
paste = { workspace = true }
serde = { workspace = true }
serde = { workspace = true, optional = true }
[dev-dependencies]
serde_json = { workspace = true }

View file

@ -59,4 +59,17 @@ values inside JSON strings, for example:
`binary` here is (de)serialized as a normal [`String`]. In order to be clear on which fields contain binary data, the struct fields that have them will use [`crate::BinaryString`] instead of [`String`].
TODO: list the specific types.
TODO: list the specific types.
# Feature flags
List of feature flags for `cuprate-rpc-types`.
All are enabled by default.
| Feature flag | Does what |
|--------------|-----------|
| `json` | Enables the [`crate::json`] module
| `bin` | Enables the [`crate::bin`] module
| `other` | Enables the [`crate::other`] module
| `serde` | Implements `serde` on all types
| `epee` | Implements `epee_encoding` on all types

View file

@ -1,4 +1,5 @@
#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
//---------------------------------------------------------------------------------------------------- Lints
// Forbid lints.
// Our code, and code generated (e.g macros) cannot overrule these.
@ -111,6 +112,12 @@ pub use constants::{
pub use status::Status;
pub mod base;
#[cfg(feature = "bin")]
#[cfg_attr(docsrs, doc(cfg(feature = "bin")))]
pub mod bin;
#[cfg(feature = "json")]
#[cfg_attr(docsrs, doc(cfg(feature = "json")))]
pub mod json;
#[cfg(feature = "other")]
#[cfg_attr(docsrs, doc(cfg(feature = "other")))]
pub mod other;