Struct hrpc_build::Builder
source · [−]pub struct Builder { /* private fields */ }
Expand description
Service generator builder.
Implementations
sourceimpl Builder
impl Builder
sourcepub fn build_client(self, enable: bool) -> Self
pub fn build_client(self, enable: bool) -> Self
Enable or disable hRPC client code generation.
sourcepub fn build_server(self, enable: bool) -> Self
pub fn build_server(self, enable: bool) -> Self
Enable or disable hRPC server code generation.
sourcepub fn out_dir(self, out_dir: impl AsRef<Path>) -> Self
pub fn out_dir(self, out_dir: impl AsRef<Path>) -> Self
Set the output directory to generate code to.
Defaults to the OUT_DIR
environment variable.
sourcepub fn extern_path(
self,
proto_path: impl AsRef<str>,
rust_path: impl AsRef<str>
) -> Self
pub fn extern_path(
self,
proto_path: impl AsRef<str>,
rust_path: impl AsRef<str>
) -> Self
Declare externally provided Protobuf package or type.
Passed directly to prost_build::Config.extern_path
.
Note that both the Protobuf path and the rust package paths should both be fully qualified.
i.e. Protobuf paths should start with “.” and rust paths should start with “::”
sourcepub fn field_attribute<P: AsRef<str>, A: AsRef<str>>(
self,
path: P,
attribute: A
) -> Self
pub fn field_attribute<P: AsRef<str>, A: AsRef<str>>(
self,
path: P,
attribute: A
) -> Self
Add additional attribute to matched messages, enums, and one-offs.
Passed directly to prost_build::Config.field_attribute
.
sourcepub fn type_attribute<P: AsRef<str>, A: AsRef<str>>(
self,
path: P,
attribute: A
) -> Self
pub fn type_attribute<P: AsRef<str>, A: AsRef<str>>(
self,
path: P,
attribute: A
) -> Self
Add additional attribute to matched messages, enums, and one-offs.
Passed directly to prost_build::Config.type_attribute
.
sourcepub fn proto_path(self, proto_path: impl AsRef<str>) -> Self
pub fn proto_path(self, proto_path: impl AsRef<str>) -> Self
Set the path to where hrpc-rs will search for the Request/Response proto structs
live relative to the module where you call include_proto!
.
This defaults to super
since hrpc-rs will generate code in a module.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnwindSafe for Builder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more