[][src]Struct protoc::ProtocLangOut

pub struct ProtocLangOut { /* fields omitted */ }

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]

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]

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]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.