AllowUndocumentedResponses

Trait AllowUndocumentedResponses 

Source
pub trait AllowUndocumentedResponses<T, E> {
    // Required method
    fn allow_undocumented(self) -> Result<UndocumentedResponse<T>, E>;
}
Expand description

If you want to suffer handle undocumented responses you can use this extension trait on client API return values to move Undocumented from Err to Ok variant.

Example:

    match client
        .api_create_my_address(1)
        .await
        .allow_undocumented()?
    {
        UndocumentedResponse::Documented(resp) => {
             // Process expected response...
        }
        UndocumentedResponse::Undocumented(resp) => {
            // Do something with the unexpected response...
        }
    }
}

Required Methods§

Implementations on Foreign Types§

Source§

impl<T, E> AllowUndocumentedResponses<T, E> for Result<T, E>
where E: ClientApiError,

Implementors§