Skip to main content

spicedb_grpc_tonic/
lib.rs

1//! Authzed/SpiceDB gRPC API types and clients generated from [buf.build/authzed/api](https://buf.build/authzed/api).
2//!
3//! The published crate ships with generated code in `src/generated/` so consumers do not need buf/protoc.
4//! To regenerate (with buf installed), delete `src/generated/` and run `cargo build`, or run `scripts/regenerate-spicedb-grpc-tonic.sh`.
5
6#![allow(clippy::all)]
7#![allow(dead_code)] // generated proto types and dependencies
8
9mod generated {
10    pub mod google {
11        pub mod api {
12            #[cfg(proto_checked_in)]
13            include!("generated/google.api.rs");
14            #[cfg(not(proto_checked_in))]
15            include!(concat!(env!("OUT_DIR"), "/google.api.rs"));
16        }
17        pub mod rpc {
18            #[cfg(proto_checked_in)]
19            include!("generated/google.rpc.rs");
20            #[cfg(not(proto_checked_in))]
21            include!(concat!(env!("OUT_DIR"), "/google.rpc.rs"));
22        }
23    }
24
25    pub mod buf {
26        pub mod validate {
27            #[cfg(proto_checked_in)]
28            include!("generated/buf.validate.rs");
29            #[cfg(not(proto_checked_in))]
30            include!(concat!(env!("OUT_DIR"), "/buf.validate.rs"));
31        }
32    }
33
34    pub mod validate {
35        #[cfg(proto_checked_in)]
36        include!("generated/validate.rs");
37        #[cfg(not(proto_checked_in))]
38        include!(concat!(env!("OUT_DIR"), "/validate.rs"));
39    }
40
41    pub mod grpc {
42        pub mod gateway {
43            pub mod protoc_gen_openapiv2 {
44                pub mod options {
45                    #[cfg(proto_checked_in)]
46                    include!("generated/grpc.gateway.protoc_gen_openapiv2.options.rs");
47                    #[cfg(not(proto_checked_in))]
48                    include!(concat!(
49                        env!("OUT_DIR"),
50                        "/grpc.gateway.protoc_gen_openapiv2.options.rs"
51                    ));
52                }
53            }
54        }
55    }
56
57    pub mod authzed {
58        pub mod api {
59            pub mod v1 {
60                #[cfg(proto_checked_in)]
61                include!("generated/authzed.api.v1.rs");
62                #[cfg(not(proto_checked_in))]
63                include!(concat!(env!("OUT_DIR"), "/authzed.api.v1.rs"));
64            }
65        }
66    }
67}
68
69pub use generated::authzed::api::v1;