pub struct ConfigBuilder { /* private fields */ }Implementations§
Source§impl ConfigBuilder
impl ConfigBuilder
pub fn new() -> Self
Sourcepub fn root_dir(self, root_dir: impl Display) -> Self
pub fn root_dir(self, root_dir: impl Display) -> Self
Root Directory of the location of your .proto files.
This is a folder relative to the workspace directory.
Sourcepub fn dependency(self, dependency: Dependency) -> Self
pub fn dependency(self, dependency: Dependency) -> Self
Define the dependencies of this project, refer to Dependency for documentation.
Can be called multiple times for multiple dependencies.
Sourcepub fn protos(self, protos: impl IntoIterator<Item = impl Display>) -> Self
pub fn protos(self, protos: impl IntoIterator<Item = impl Display>) -> Self
Define the proto files for compilation.
For a gRPC setup this would only require you to references the wanted services, dependencies of those services will be imported.
Sourcepub fn file_descriptors(self, file_descriptors: bool) -> Self
pub fn file_descriptors(self, file_descriptors: bool) -> Self
Generate file descriptors
Sourcepub fn codegen(self, codegen_path: impl ToString) -> Self
pub fn codegen(self, codegen_path: impl ToString) -> Self
Instead of just making the manifest, forcing to use chur::include_tree
just dump the code into a file at the provided path.
This works better with rust-analyzer.
Provided path should be relative to the workspace Cargo.toml.
Sourcepub fn build(self) -> ChurResult<Config>
pub fn build(self) -> ChurResult<Config>
Build the ConfigBuilder into a Config
This changes the directories used to be absolute.
Trait Implementations§
Source§impl Debug for ConfigBuilder
impl Debug for ConfigBuilder
Source§impl Default for ConfigBuilder
impl Default for ConfigBuilder
Source§fn default() -> ConfigBuilder
fn default() -> ConfigBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ConfigBuilder
impl RefUnwindSafe for ConfigBuilder
impl Send for ConfigBuilder
impl Sync for ConfigBuilder
impl Unpin for ConfigBuilder
impl UnwindSafe for ConfigBuilder
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