[][src]Macro tonic_include_protos::include_protos

include_protos!() { /* proc-macro */ }

Include all generated proto server and client items.

tonic_include_protos::include_protos!();

This macro will construct mod tree based on grpc package names. For example if you have two generated by tonic_build files in OUT_DIR: package.api.example.rs and package.api.another_example.rs result will look like this:

If ['OUT_DIR'] won't work for you (when you set tonic_build to save files in other directory or for some other reason) you can set 'TIP_OUT_DIR' environment variable to point on the directory you need

pub mod package{
    pub mod api {
        pub mod example {
            include!(concat!(env!("OUT_DIR"), "/google.api.example.rs"));
        }
        pub mod another_example {
            include!(concat!(env!("OUT_DIR"), "/google.api.another_example.rs"));
        }
    }
}