Trait RetryableEndpoint

Source
pub trait RetryableEndpoint: DynClone {
    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<Body>, Self::RenderRequestError>;
    fn parse_response(
        &self,
        response: Response<Body>,
        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§

Required Methods§

Provided Methods§

Trait Implementations§

Source§

impl<RetryReason, RenderRequestError, ParseResponseOutput, ParseResponseError> Debug for dyn RetryableEndpoint<RetryReason = RetryReason, RenderRequestError = RenderRequestError, ParseResponseOutput = ParseResponseOutput, ParseResponseError = ParseResponseError>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<RetryReason, RenderRequestError, ParseResponseOutput, ParseResponseError> Debug for dyn RetryableEndpoint<RetryReason = RetryReason, RenderRequestError = RenderRequestError, ParseResponseOutput = ParseResponseOutput, ParseResponseError = ParseResponseError> + Send + Sync

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Implementors§