pub struct RestClientOptions {
pub json_int64_as_number: bool,
pub ignore_unknown_enum_values: bool,
pub error_module: Option<ErrorModuleConfig>,
pub form_encoded_methods: Vec<String>,
pub path_fields_in_body_methods: Vec<String>,
pub json_query_packages: Vec<String>,
pub user_agent: Option<String>,
pub resource_features: bool,
pub handler_impls: Option<ClientHandlerImpls>,
}Expand description
Wire-format and error options of the generated REST client. Every option is off by default.
Fields§
§json_int64_as_number: boolWrite 64-bit integers as JSON numbers instead of proto3-JSON strings, and whole numbers
of google.protobuf.Value/Struct/ListValue as integers (1, not 1.0). Emits a
json_int64 module into the models mod.rs that the trestle CLI points buffa’s helpers
at (see CodeGenConfig::json_int64_module_path). Reading accepts both forms. Buffa only.
ignore_unknown_enum_values: boolParse responses with buffa’s ignore_unknown_enum_values: an unknown enum name becomes
the zero value instead of failing the response. Buffa only.
error_module: Option<ErrorModuleConfig>Generate the client error module (error.rs); the clients then return its Result
instead of CodeGenConfig::result_type_path. When None, the crate supplies
crate::error::parse_error_response.
form_encoded_methods: Vec<String>RPCs (package.Service.Method) whose request body is sent form-encoded.
path_fields_in_body_methods: Vec<String>RPCs (package.Service.Method) whose request body keeps the path fields, for APIs that
want them in both places.
json_query_packages: Vec<String>Proto packages whose query keys are the JSON (lowerCamelCase) names. Elsewhere a query
key is the proto name, or the field’s explicit json_name.
user_agent: Option<String>The User-Agent product of the generated reqwest transport
(<product>/<client crate version>); not sent in the browser. Needs that transport.
resource_features: boolGate each service behind a cargo feature named after its model package
(my.catalogs.v1 → catalogs): the service modules, the aggregate client’s accessors
and imports, and the child navigators of resource clients (on the child’s feature). The
client crate declares the features.
handler_impls: Option<ClientHandlerImpls>Implement the server handler traits for the per-service clients. See
ClientHandlerImpls.
Trait Implementations§
Source§impl Clone for RestClientOptions
impl Clone for RestClientOptions
Source§impl Debug for RestClientOptions
impl Debug for RestClientOptions
Auto Trait Implementations§
impl Forget for RestClientOptions
impl Freeze for RestClientOptions
impl RefUnwindSafe for RestClientOptions
impl Send for RestClientOptions
impl Sync for RestClientOptions
impl Unpin for RestClientOptions
impl UnsafeUnpin for RestClientOptions
impl UnwindSafe for RestClientOptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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