[−][src]Struct protoc::ProtocLangOut
protoc --lang_out=... ...
command builder and spawner.
Examples
use protoc::ProtocLangOut; ProtocLangOut::new() .lang("go") .include("protos") .include("more-protos") .out_dir("generated-protos") .run() .unwrap();
Methods
impl ProtocLangOut
[src]
pub fn new() -> Self
[src]
Arguments to the protoc
found in $PATH
pub fn lang(&mut self, lang: &str) -> &mut Self
[src]
Set LANG
part in --LANG_out=...
pub fn out_dir(&mut self, out_dir: impl AsRef<Path>) -> &mut Self
[src]
Set --LANG_out=...
param
pub fn plugin(&mut self, plugin: impl AsRef<OsStr>) -> &mut Self
[src]
Set --plugin
param. Not needed if plugin is in $PATH
pub fn include(&mut self, include: impl AsRef<Path>) -> &mut Self
[src]
Append a path to -I
args
pub fn includes(
&mut self,
includes: impl IntoIterator<Item = impl AsRef<Path>>
) -> &mut Self
[src]
&mut self,
includes: impl IntoIterator<Item = impl AsRef<Path>>
) -> &mut Self
Append multiple paths to -I
args
pub fn input(&mut self, input: impl AsRef<Path>) -> &mut Self
[src]
Append a .proto
file path to compile
pub fn inputs(
&mut self,
inputs: impl IntoIterator<Item = impl AsRef<Path>>
) -> &mut Self
[src]
&mut self,
inputs: impl IntoIterator<Item = impl AsRef<Path>>
) -> &mut Self
Append multiple .proto
file paths to compile
pub fn run(&self) -> Result<()>
[src]
Execute protoc
with given args
Trait Implementations
impl Default for ProtocLangOut
[src]
fn default() -> ProtocLangOut
[src]
Auto Trait Implementations
impl RefUnwindSafe for ProtocLangOut
impl Send for ProtocLangOut
impl Sync for ProtocLangOut
impl Unpin for ProtocLangOut
impl UnwindSafe for ProtocLangOut
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,