pub fn compile<P: AsRef<Path>>(self, protos: &[P], includes: &[P]) -> io::Result<()> {
        let mut config = Config::new();

        #[cfg(feature = "rustfmt")]
        let format = self.format;

        let out_dir = self
            .out_dir
            .clone()
            .unwrap_or_else(|| PathBuf::from(std::env::var("OUT_DIR").unwrap()));

        config.out_dir(out_dir.clone());
        config.service_generator(Box::new(ServiceGenerator::new(self)));
        config.compile_protos(protos, includes)?;

        #[cfg(feature = "rustfmt")]
        {
            if format {
                fmt(out_dir.to_str().expect("Expected utf8 out_dir"));
            }
        }

        Ok(())
    }
/// Compile the .proto files and execute code generation.
Compile the .proto files and execute code generation.
Compile the . proto files and execute code generation .
pub fn compile<P: AsRef<Path>>(self, protos: &[P], includes: &[P]) -> io::Result<()> {
        let mut config = Config::new();
        #[cfg(feature = "rustfmt")]
        let format = self.format;
        let out_dir = self
            .out_dir
            .clone()
            .unwrap_or_else(|| PathBuf::from(std::env::var("OUT_DIR").unwrap()));
        config.out_dir(out_dir.clone());
        config.service_generator(Box::new(ServiceGenerator::new(self)));
        config.compile_protos(protos, includes)?;
        #[cfg(feature = "rustfmt")]
        {
            if format {
                fmt(out_dir.to_str().expect("Expected utf8 out_dir"));
            }
        }
        Ok(())
    }
pub fn compile < P : AsRef < Path > > ( self , protos : & [ P ] , includes : & [ P ] ) -> io :: Result < ( ) > { let mut config = Config :: new ( ) ; # [ cfg ( feature " " ) ] let format = self . format ; let out_dir = self . out_dir . clone ( ) . unwrap_or_else ( | | PathBuf :: from ( std :: env :: var ( " " ) . unwrap ( ) ) ) ; config . out_dir ( out_dir . clone ( ) ) ; config . service_generator ( Box :: new ( ServiceGenerator :: new ( self ) ) ) ; config . compile_protos ( protos , includes ) ? ; # [ cfg ( feature " " ) ] { if format { fmt ( out_dir . to_str ( ) . expect ( " " ) ) ; } } Ok ( ( ) ) }
Compile the .proto files and execute code generation.
Compile the . proto files and execute code generation .
self
protos
&[P]
includes
&[P]
self
protos
&[P]
includes
&[P]