Struct crux_http::testing::ResponseBuilder
source · pub struct ResponseBuilder<Body> { /* private fields */ }
Expand description
Allows users to build an http response.
This is mostly expected to be useful in tests rather than application code.
Implementations§
source§impl ResponseBuilder<Vec<u8>>
impl ResponseBuilder<Vec<u8>>
sourcepub fn ok() -> ResponseBuilder<Vec<u8>>
pub fn ok() -> ResponseBuilder<Vec<u8>>
Constructs a new ResponseBuilder with the 200 OK status code.
sourcepub fn with_status(status: StatusCode) -> ResponseBuilder<Vec<u8>>
pub fn with_status(status: StatusCode) -> ResponseBuilder<Vec<u8>>
Constructs a new ResponseBuilder with the specified status code.
source§impl<Body> ResponseBuilder<Body>
impl<Body> ResponseBuilder<Body>
Auto Trait Implementations§
impl<Body> Freeze for ResponseBuilder<Body>where
Body: Freeze,
impl<Body> RefUnwindSafe for ResponseBuilder<Body>where
Body: RefUnwindSafe,
impl<Body> Send for ResponseBuilder<Body>where
Body: Send,
impl<Body> Sync for ResponseBuilder<Body>where
Body: Sync,
impl<Body> Unpin for ResponseBuilder<Body>where
Body: Unpin,
impl<Body> UnwindSafe for ResponseBuilder<Body>where
Body: 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