From 85ba42a3ecf860f007aa2b6d50ab3234b9c1ecb1 Mon Sep 17 00:00:00 2001 From: Casper Meijn Date: Tue, 2 Apr 2024 16:13:09 +0200 Subject: [PATCH] docs: Document feature flags (#1003) --- README.md | 5 +++++ prost-build/src/lib.rs | 4 ++++ prost-types/src/lib.rs | 3 +++ 3 files changed, 12 insertions(+) diff --git a/README.md b/README.md index 6307ed632..8bbb9a3ee 100644 --- a/README.md +++ b/README.md @@ -463,6 +463,11 @@ The prost project maintains flakes support for local development. Once you have nix and nix flakes setup you can just run `nix develop` to get a shell configured with the required dependencies to compile the whole project. +## Feature Flags +- `std`: Enable integration with standard library. Disable this feature for `no_std` support. This feature is enabled by default. +- `derive`: Enable integration with `prost-derive`. Disable this feature to reduce compile times. This feature is enabled by default. +- `prost-derive`: Deprecated. Alias for `derive` feature. +- `no-recursion-limit`: Disable the recursion limit. The recursion limit is 100 and cannot be customized. ## FAQ diff --git a/prost-build/src/lib.rs b/prost-build/src/lib.rs index 2811e5854..4c5553109 100644 --- a/prost-build/src/lib.rs +++ b/prost-build/src/lib.rs @@ -82,6 +82,10 @@ //! That's it! Run `cargo doc` to see documentation for the generated code. The full //! example project can be found on [GitHub](https://github.com/danburkert/snazzy). //! +//! ## Feature Flags +//! - `format`: Format the generated output. This feature is enabled by default. +//! - `cleanup-markdown`: Clean up Markdown in protobuf docs. Enable this to clean up protobuf files from third parties. +//! //! ### Cleaning up Markdown in code docs //! //! If you are using protobuf files from third parties, where the author of the protobuf diff --git a/prost-types/src/lib.rs b/prost-types/src/lib.rs index 33458c78c..3196f4426 100644 --- a/prost-types/src/lib.rs +++ b/prost-types/src/lib.rs @@ -7,6 +7,9 @@ //! //! See the [Protobuf reference][1] for more information about well-known types. //! +//! ## Feature Flags +//! - `std`: Enable integration with standard library. Disable this feature for `no_std` support. This feature is enabled by default. +//! //! [1]: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf #![cfg_attr(not(feature = "std"), no_std)]