Struct RamaTtrpcProtoBuilder
pub struct RamaTtrpcProtoBuilder { /* private fields */ }ttrpc only.Expand description
Builder for configuring and generating ttRPC code from .proto files.
Analogous to rama-grpc-build’s builder.
Implementations§
§impl RamaTtrpcProtoBuilder
impl RamaTtrpcProtoBuilder
pub fn with_out_dir(self, out_dir: impl AsRef<Path>) -> RamaTtrpcProtoBuilder
pub fn with_out_dir(self, out_dir: impl AsRef<Path>) -> RamaTtrpcProtoBuilder
Set the output directory for generated code.
Defaults to the Cargo OUT_DIR. A build script that generates code for multiple
RPC flavours can point each at its own subdirectory to avoid file-name collisions.
pub fn set_out_dir(
&mut self,
out_dir: impl AsRef<Path>,
) -> &mut RamaTtrpcProtoBuilder
pub fn set_out_dir( &mut self, out_dir: impl AsRef<Path>, ) -> &mut RamaTtrpcProtoBuilder
Set the output directory for generated code.
Defaults to the Cargo OUT_DIR. A build script that generates code for multiple
RPC flavours can point each at its own subdirectory to avoid file-name collisions.
pub fn with_extern_path(
self,
proto_path: impl AsRef<str>,
rust_path: impl AsRef<str>,
) -> RamaTtrpcProtoBuilder
pub fn with_extern_path( self, proto_path: impl AsRef<str>, rust_path: impl AsRef<str>, ) -> RamaTtrpcProtoBuilder
Declare an externally provided Protobuf package or type.
Passed directly to prost_build::Config::extern_path. Useful to share generated
message types with another codegen (e.g. rama-grpc-build) instead of
regenerating them.
pub fn set_extern_path(
&mut self,
proto_path: impl AsRef<str>,
rust_path: impl AsRef<str>,
) -> &mut RamaTtrpcProtoBuilder
pub fn set_extern_path( &mut self, proto_path: impl AsRef<str>, rust_path: impl AsRef<str>, ) -> &mut RamaTtrpcProtoBuilder
Declare an externally provided Protobuf package or type.
Passed directly to prost_build::Config::extern_path. Useful to share generated
message types with another codegen (e.g. rama-grpc-build) instead of
regenerating them.
pub fn with_protoc_arg(self, arg: impl AsRef<str>) -> RamaTtrpcProtoBuilder
pub fn with_protoc_arg(self, arg: impl AsRef<str>) -> RamaTtrpcProtoBuilder
Add an argument to the protoc invocation.
Passed directly to prost_build::Config::protoc_arg.
pub fn set_protoc_arg(
&mut self,
arg: impl AsRef<str>,
) -> &mut RamaTtrpcProtoBuilder
pub fn set_protoc_arg( &mut self, arg: impl AsRef<str>, ) -> &mut RamaTtrpcProtoBuilder
Add an argument to the protoc invocation.
Passed directly to prost_build::Config::protoc_arg.
pub fn with_skip_protoc_run(self) -> RamaTtrpcProtoBuilder
pub fn with_skip_protoc_run(self) -> RamaTtrpcProtoBuilder
Skip running protoc and instead use a pre-generated file descriptor set.
Passed directly to prost_build::Config::skip_protoc_run. This requires a file
descriptor set to be available, so with_file_descriptor_set_path /
set_file_descriptor_set_path must also be set — otherwise codegen fails.
pub fn set_skip_protoc_run(&mut self) -> &mut RamaTtrpcProtoBuilder
pub fn set_skip_protoc_run(&mut self) -> &mut RamaTtrpcProtoBuilder
Skip running protoc and instead use a pre-generated file descriptor set.
Passed directly to prost_build::Config::skip_protoc_run. This requires a file
descriptor set to be available, so with_file_descriptor_set_path /
set_file_descriptor_set_path must also be set — otherwise codegen fails.
pub fn with_file_descriptor_set_path(
self,
path: impl AsRef<Path>,
) -> RamaTtrpcProtoBuilder
pub fn with_file_descriptor_set_path( self, path: impl AsRef<Path>, ) -> RamaTtrpcProtoBuilder
Set the path to the protobuf file descriptor set.
Passed directly to prost_build::Config::file_descriptor_set_path. When protoc
runs, the descriptor set is written to this path; when with_skip_protoc_run /
set_skip_protoc_run is enabled, prost reads a pre-generated descriptor set from
it instead of invoking protoc. It must therefore be provided whenever protoc is
skipped.
pub fn set_file_descriptor_set_path(
&mut self,
path: impl AsRef<Path>,
) -> &mut RamaTtrpcProtoBuilder
pub fn set_file_descriptor_set_path( &mut self, path: impl AsRef<Path>, ) -> &mut RamaTtrpcProtoBuilder
Set the path to the protobuf file descriptor set.
Passed directly to prost_build::Config::file_descriptor_set_path. When protoc
runs, the descriptor set is written to this path; when with_skip_protoc_run /
set_skip_protoc_run is enabled, prost reads a pre-generated descriptor set from
it instead of invoking protoc. It must therefore be provided whenever protoc is
skipped.
Trait Implementations§
§impl Clone for RamaTtrpcProtoBuilder
impl Clone for RamaTtrpcProtoBuilder
§fn clone(&self) -> RamaTtrpcProtoBuilder
fn clone(&self) -> RamaTtrpcProtoBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for RamaTtrpcProtoBuilder
impl Debug for RamaTtrpcProtoBuilder
§impl Default for RamaTtrpcProtoBuilder
impl Default for RamaTtrpcProtoBuilder
§fn default() -> RamaTtrpcProtoBuilder
fn default() -> RamaTtrpcProtoBuilder
Auto Trait Implementations§
impl Freeze for RamaTtrpcProtoBuilder
impl RefUnwindSafe for RamaTtrpcProtoBuilder
impl Send for RamaTtrpcProtoBuilder
impl Sync for RamaTtrpcProtoBuilder
impl Unpin for RamaTtrpcProtoBuilder
impl UnsafeUnpin for RamaTtrpcProtoBuilder
impl UnwindSafe for RamaTtrpcProtoBuilder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more