Skip to content

Commit ee837cb

Browse files
Fix docs for prost-reflect-build (#169)
1 parent 40bf30d commit ee837cb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

prost-reflect-build/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
//! `prost-reflect-build` contains [`Builder`] to configure [`prost_build::Config`]
22
//! to derive [`prost_reflect::ReflectMessage`] for all messages in protocol buffers.
33
//!
4-
//! The simplest way to generate protocol buffer API:
4+
//! The simplest way to generate [`prost_reflect::ReflectMessage`] is:
55
//!
66
//! ```no_run
77
//! // build.rs
88
//! use prost_reflect_build::Builder;
99
//!
1010
//! Builder::new()
11+
//! .descriptor_pool("crate::DESCRIPTOR_POOL")
1112
//! .compile_protos(&["path/to/protobuf.proto"], &["path/to/include"])
1213
//! .expect("Failed to compile protos");
1314
//! ```
1415
//!
15-
//! With default configuration, `lib.rs` must include the following lines for reflection.
16+
//! Either [`Builder::descriptor_pool`] or [`Builder::file_descriptor_set_bytes`] must be set to an expression giving the implementation access to descriptors.
17+
//! For example when using `descriptor_pool` a static instance of [`DescriptorPool`] must be available:
1618
//!
1719
//! ```ignore
1820
//! static DESCRIPTOR_POOL: Lazy<DescriptorPool> = Lazy::new(|| DescriptorPool::decode(

0 commit comments

Comments
 (0)