pub struct HandlerContractConfig {
pub trait_name: String,
pub dispatch_method: String,
pub is_async: bool,
pub wire_request_type: Option<String>,
pub wire_response_type: Option<String>,
pub optional_overrides: Vec<String>,
pub dispatch_extra_params: Vec<String>,
pub wire_param_name: Option<String>,
pub dispatch_return_type: Option<String>,
pub response_adapter: Option<String>,
}Expand description
Configuration for one handler-contract entry in [[crates.handler_contracts]].
This augments a trait already present in the extracted surface with service-specific metadata: the dispatch method that backends must bridge, whether that method is async, and the names of the wire request/response DTOs.
[[crates.handler_contracts]]
trait_name = "Handler"
dispatch_method = "call"
is_async = true
wire_request_type = "RequestData"
wire_response_type = "ResponseData"Fields§
§trait_name: StringName of the Rust trait in the surface (e.g. "Handler").
dispatch_method: StringName of the primary dispatch method (e.g. "call").
is_async: boolWhether the dispatch method is async (defaults to true).
wire_request_type: Option<String>Name of the wire request DTO (e.g. "RequestData").
When absent, the dispatch method’s signature is used verbatim.
wire_response_type: Option<String>Name of the wire response DTO (e.g. "ResponseData").
When absent, the dispatch method’s return type is used verbatim.
optional_overrides: Vec<String>Methods that backends may optionally override (have default implementations in the trait). Subset of the trait’s method names.
dispatch_extra_params: Vec<String>Verbatim parameter declarations the generated bridge inserts before the wire request parameter and then ignores in the body. Used when the dispatch method has leading parameters whose concrete types cannot be reconstructed from the sanitized surface (e.g. foreign framework types). Default: none.
wire_param_name: Option<String>Name of the wire request parameter in the generated dispatch signature.
When absent, defaults to "request".
dispatch_return_type: Option<String>Verbatim return type for the generated dispatch future’s Output. When absent,
the bridge synthesizes Result<{wire_response}, Box<dyn Error + Send + Sync>>.
Set this when the trait’s dispatch returns a library-specific type the bridge
must produce via Self::response_adapter.
response_adapter: Option<String>Path to a library function that converts the bridge’s
Result<{wire_response}, Box<dyn Error + Send + Sync>> outcome into the
Self::dispatch_return_type. When absent, the bridge returns the wire response
directly. The function is opaque to the generator — it simply emits a call to it.
Trait Implementations§
Source§impl Clone for HandlerContractConfig
impl Clone for HandlerContractConfig
Source§fn clone(&self) -> HandlerContractConfig
fn clone(&self) -> HandlerContractConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HandlerContractConfig
impl Debug for HandlerContractConfig
Source§impl<'de> Deserialize<'de> for HandlerContractConfig
impl<'de> Deserialize<'de> for HandlerContractConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for HandlerContractConfig
impl JsonSchema for HandlerContractConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for HandlerContractConfig
impl RefUnwindSafe for HandlerContractConfig
impl Send for HandlerContractConfig
impl Sync for HandlerContractConfig
impl Unpin for HandlerContractConfig
impl UnsafeUnpin for HandlerContractConfig
impl UnwindSafe for HandlerContractConfig
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
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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