pub struct ResponseAssertion<T> { /* private fields */ }Expand description
Response assertion builder for server functions that return HTTP-like responses.
Implementations§
Source§impl<T> ResponseAssertion<T>
impl<T> ResponseAssertion<T>
Sourcepub fn with_status(self, status: StatusCode) -> Self
pub fn with_status(self, status: StatusCode) -> Self
Set the expected status code.
Sourcepub fn into_value(self) -> T
pub fn into_value(self) -> T
Consume and return the value.
Source§impl<T: HasStatusCode> ResponseAssertion<T>
impl<T: HasStatusCode> ResponseAssertion<T>
Sourcepub fn should_have_status(&self, expected: StatusCode)
pub fn should_have_status(&self, expected: StatusCode)
Assert that the status code matches.
Sourcepub fn should_be_success(&self)
pub fn should_be_success(&self)
Assert that the response is successful (2xx).
Sourcepub fn should_be_client_error(&self)
pub fn should_be_client_error(&self)
Assert that the response is a client error (4xx).
Sourcepub fn should_be_server_error(&self)
pub fn should_be_server_error(&self)
Assert that the response is a server error (5xx).
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for ResponseAssertion<T>where
T: Freeze,
impl<T> RefUnwindSafe for ResponseAssertion<T>where
T: RefUnwindSafe,
impl<T> Send for ResponseAssertion<T>where
T: Send,
impl<T> Sync for ResponseAssertion<T>where
T: Sync,
impl<T> Unpin for ResponseAssertion<T>where
T: Unpin,
impl<T> UnsafeUnpin for ResponseAssertion<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for ResponseAssertion<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<E> ServerFnErrorAssertions<E> for Ewhere
E: Debug,
impl<E> ServerFnErrorAssertions<E> for Ewhere
E: Debug,
Source§fn should_contain_message(&self, expected: &str)where
E: Display,
fn should_contain_message(&self, expected: &str)where
E: Display,
Assert that the error message contains the specified text.
Source§fn should_have_message(&self, expected: &str)where
E: Display,
fn should_have_message(&self, expected: &str)where
E: Display,
Assert that the error message matches exactly.