pub trait RetryableEndpoint {
type RetryReason: Send + Sync + Clone;
type RenderRequestError: Error + Send + Sync + 'static;
type ParseResponseOutput;
type ParseResponseError: Error + Send + Sync + 'static;
// Required methods
fn render_request(
&self,
retry: Option<&RetryableEndpointRetry<Self::RetryReason>>,
) -> Result<Request<Vec<u8>>, Self::RenderRequestError>;
fn parse_response(
&self,
response: Response<Vec<u8>>,
retry: Option<&RetryableEndpointRetry<Self::RetryReason>>,
) -> Result<Result<Self::ParseResponseOutput, Self::RetryReason>, Self::ParseResponseError>;
// Provided methods
fn max_retry_count(&self) -> usize { ... }
fn next_retry_in(
&self,
retry: &RetryableEndpointRetry<Self::RetryReason>,
) -> Duration { ... }
}Required Associated Types§
type RetryReason: Send + Sync + Clone
type RenderRequestError: Error + Send + Sync + 'static
type ParseResponseOutput
type ParseResponseError: Error + Send + Sync + 'static
Required Methods§
fn render_request( &self, retry: Option<&RetryableEndpointRetry<Self::RetryReason>>, ) -> Result<Request<Vec<u8>>, Self::RenderRequestError>
fn parse_response( &self, response: Response<Vec<u8>>, retry: Option<&RetryableEndpointRetry<Self::RetryReason>>, ) -> Result<Result<Self::ParseResponseOutput, Self::RetryReason>, Self::ParseResponseError>
Provided Methods§
fn max_retry_count(&self) -> usize
fn next_retry_in( &self, retry: &RetryableEndpointRetry<Self::RetryReason>, ) -> Duration
Trait Implementations§
Source§impl<RetryReason, RenderRequestError, ParseResponseOutput, ParseResponseError> Debug for dyn RetryableEndpoint<ParseResponseError = ParseResponseError, ParseResponseOutput = ParseResponseOutput, RetryReason = RetryReason, RenderRequestError = RenderRequestError>
impl<RetryReason, RenderRequestError, ParseResponseOutput, ParseResponseError> Debug for dyn RetryableEndpoint<ParseResponseError = ParseResponseError, ParseResponseOutput = ParseResponseOutput, RetryReason = RetryReason, RenderRequestError = RenderRequestError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".