pub struct Codegen { /* private fields */ }
Expand description
Utility to generate .rs
files.
Implementations§
Source§impl Codegen
impl Codegen
Sourcepub fn includes(
&mut self,
includes: impl IntoIterator<Item = impl AsRef<Path>>,
) -> &mut Self
pub fn includes( &mut self, includes: impl IntoIterator<Item = impl AsRef<Path>>, ) -> &mut Self
Append multiple paths to -I
args
Sourcepub fn input(&mut self, input: impl AsRef<Path>) -> &mut Self
pub fn input(&mut self, input: impl AsRef<Path>) -> &mut Self
Append a .proto
file path to compile
Sourcepub fn inputs(
&mut self,
inputs: impl IntoIterator<Item = impl AsRef<Path>>,
) -> &mut Self
pub fn inputs( &mut self, inputs: impl IntoIterator<Item = impl AsRef<Path>>, ) -> &mut Self
Append multiple .proto
file paths to compile
Sourcepub fn rust_protobuf(&mut self, rust_protobuf: bool) -> &mut Self
pub fn rust_protobuf(&mut self, rust_protobuf: bool) -> &mut Self
Generate rust-protobuf files along with rust-gprc
Sourcepub fn rust_protobuf_customize(
&mut self,
rust_protobuf_customize: Customize,
) -> &mut Self
pub fn rust_protobuf_customize( &mut self, rust_protobuf_customize: Customize, ) -> &mut Self
Generate rust-protobuf files along with rust-gprc
Sourcepub fn run(&self) -> Result<()>
pub fn run(&self) -> Result<()>
Run the codegen.
Generate _grpc.rs
files, and if rust_protobuf_customize
is specified, generate rust-protobuf .rs
files too.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Codegen
impl RefUnwindSafe for Codegen
impl Send for Codegen
impl Sync for Codegen
impl Unpin for Codegen
impl UnwindSafe for Codegen
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more