1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// lifted protobuf-mdbook internals; public API documented in README
//! Protobuf → switchback parser.
//!
//! `switchback-protobuf` implements [`ContractFamily`](switchback_traits::ContractFamily) and
//! [`Contract`](switchback_traits::Contract) for protobuf and turns a set of `.proto` files
//! into a [`ReferenceManual`](switchback_traits::ReferenceManual). Its parser strategy is
//! "compile to descriptors": it runs `buf build` / `protoc` to produce a
//! `FileDescriptorSet`, then populates the switchback from it.
//!
//! # Example
//!
//! ```no_run
//! use std::path::PathBuf;
//! use switchback_protobuf::{load, input::Compiler, LoadArgs, examples::{fixtures_proto_dir, EXAMPLE_PROTO_INPUTS}};
//!
//! let export = switchback_protobuf::default_proto_deps_export();
//! let _ = switchback_protobuf::ensure_test_proto_deps(&fixtures_proto_dir(), None);
//! let args = LoadArgs {
//! compiler: Compiler::Protoc,
//! module_root: fixtures_proto_dir(),
//! inputs: EXAMPLE_PROTO_INPUTS.iter().map(|p| PathBuf::from(*p)).collect(),
//! proto_paths: vec![fixtures_proto_dir()],
//! protoc_path: None,
//! buf_path: None,
//! proto_deps_export: Some(export),
//! title: None,
//! };
//! let manual = load(&args).expect("load protos");
//! assert!(!manual.modules.is_empty());
//! ```
pub use ProtobufCategory;
pub use ProtobufContract;
pub use ProtobufFamily;
pub use Compiler;
pub use ;
pub use ;
pub use restore_sources;