Struct protobuf_build::Builder

source ·
pub struct Builder { /* private fields */ }

Implementations§

source§

impl Builder

source

pub fn generate_files(&self)

source§

impl Builder

source

pub fn new() -> Builder

source

pub fn include_google_protos(&mut self) -> &mut Self

source

pub fn generate(&self)

source

pub fn search_dir_for_protos(&mut self, proto_dir: &str) -> &mut Self

Finds proto files to operate on in the proto_dir directory.

source

pub fn files<T: ToString>(&mut self, files: &[T]) -> &mut Self

source

pub fn includes<T: ToString>(&mut self, includes: &[T]) -> &mut Self

source

pub fn append_include(&mut self, include: impl Into<String>) -> &mut Self

source

pub fn black_list<T: ToString>(&mut self, black_list: &[T]) -> &mut Self

source

pub fn append_to_black_list(&mut self, include: impl Into<String>) -> &mut Self

Add the name of an include file to the builder’s black list.

Files named on the black list are not made modules of the generated program.

source

pub fn out_dir(&mut self, out_dir: impl Into<String>) -> &mut Self

source

pub fn package_name(&mut self, package_name: impl Into<String>) -> &mut Self

If specified, a module with the given name will be generated which re-exports all generated items.

This is ignored by Prost, since Prost uses the package names of protocols in any case.

Trait Implementations§

source§

impl Default for Builder

source§

fn default() -> Builder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.