pub trait ResolveEndpoint:
Send
+ Sync
+ Debug {
// Required method
fn resolve_endpoint<'a>(
&'a self,
params: &'a EndpointResolverParams,
) -> EndpointFuture<'a> ⓘ;
// Provided method
fn finalize_params<'a>(
&'a self,
_params: &'a mut EndpointResolverParams,
) -> Result<(), BoxError> { ... }
}Expand description
Configurable endpoint resolver implementation.
Required Methods§
Sourcefn resolve_endpoint<'a>(
&'a self,
params: &'a EndpointResolverParams,
) -> EndpointFuture<'a> ⓘ
fn resolve_endpoint<'a>( &'a self, params: &'a EndpointResolverParams, ) -> EndpointFuture<'a> ⓘ
Asynchronously resolves an endpoint to use from the given endpoint parameters.
Provided Methods§
Sourcefn finalize_params<'a>(
&'a self,
_params: &'a mut EndpointResolverParams,
) -> Result<(), BoxError>
fn finalize_params<'a>( &'a self, _params: &'a mut EndpointResolverParams, ) -> Result<(), BoxError>
Finalize the service-specific concrete parameters in _params.
The EndpointResolverParams may need to include additional data at a later point,
after its creation in the read_before_execution method of an endpoint parameters interceptor.
Modifying it directly within the ResolveEndpoint::resolve_endpoint method is not feasible,
as params is passed by reference. This means that incorporating extra data would require
cloning params within the method. However, the return type EndpointFuture has a lifetime
tied to the input argument, making it impossible to return the cloned params, as its lifetime
is scoped to the method.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".