[][src]Macro tonic::include_proto

macro_rules! include_proto {
    ($package: tt) => { ... };
}

Include generated proto server and client items.

You must specify the gRPC package name.

This example is not tested
mod pb {
    tonic::include_proto!("helloworld");
}

Note:

This only works if the tonic-build output directory has been unmodified. The default output directory is set to the OUT_DIR environment variable. If the output directory has been modified, the following pattern may be used instead of this macro.

This example is not tested
mod pb {
    include!("/relative/protobuf/directory/helloworld.rs");
}

You can also use a custom environment variable using the following pattern.

This example is not tested
mod pb {
    include!(concat!(env!("PROTOBUFS"), "/helloworld.rs"));
}