Skip to main content

ExpectedError

Trait ExpectedError 

Source
pub trait ExpectedError {
    // Required methods
    fn expected_code(&self) -> String;
    fn expected_status(&self) -> Option<u16>;
}
Expand description

The error an ApiResponse::assert_api_error expects: a code such as "not_found", which checks no status, or an ErrorCode, which also checks the code’s own status.

Required Methods§

Source

fn expected_code(&self) -> String

The code, such as not_found.

Source

fn expected_status(&self) -> Option<u16>

The status the response must have, if any.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ExpectedError for &str

Implementors§