Struct pb_jelly_gen::GenProtos

source ·
pub struct GenProtos { /* private fields */ }
Expand description

A builder struct to configure the way your protos are generated, create one with GenProtos::builder()

Implementations§

source§

impl GenProtos

source

pub fn builder() -> GenProtos

Create a default builder

source

pub fn out_path<P: AsRef<Path>>(self, path: P) -> GenProtos

Set the output path for the generated code. This should be relative to the current crate’s manifest.

Defaults to the <current crate's manifest>/gen

source

pub fn abs_out_path<P: AsRef<Path>>(self, path: P) -> GenProtos

Set the output path for the generate code. This will be treated as an absolute path.

source

pub fn src_path<P: AsRef<Path>>(self, path: P) -> GenProtos

Add a path to a .proto file, or a directory containing your proto files.

source

pub fn src_paths<P: AsRef<Path>, I: IntoIterator<Item = P>>( self, paths: I ) -> GenProtos

Add a list of paths to .proto files, or to directories containing your proto files.

source

pub fn include_path<P: AsRef<Path>>(self, path: P) -> GenProtos

A path to a protobuf file, or a directory containing protobuf files, that get included in the proto compilation. Rust bindings will not be generated for these files, but the proto compiler will look at included paths for proto dependencies.

source

pub fn include_paths<P: AsRef<Path>, I: IntoIterator<Item = P>>( self, paths: I ) -> GenProtos

Paths to a protobuf files, or directories containing protobuf files, that get included in the proto compilation. Rust bindings will not be generated for these files, but the proto compiler will look at included paths for proto dependencies.

source

pub fn include_extensions(self, include: bool) -> GenProtos

Include rust/extensions.proto in the proto compilation.

Defaults to true

source

pub fn cleanup_out_path(self, cleanup: bool) -> GenProtos

If true, before proto compilation, will delete whatever exists at out_path and create a directory at that location.

source

pub fn gen_protos(self)

Consumes the builder and generates Rust bindings to your proto files.

Trait Implementations§

source§

impl Default for GenProtos

source§

fn default() -> Self

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

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where 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 T
where 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.