pub struct RecordedResponse {
pub status: i64,
pub body: String,
}Expand description
One answer a fake client gives, as a test wrote it.
It is a status and a body because that is what an http.Response is, so a
test writes down exactly what the program will see. A fake that recorded
only bodies could not produce the one thing a client most often has to
handle — a server that answered, and answered badly.
Fields§
§status: i64The status the fake server sent, such as 200 or 404.
body: StringThe body it carried.
Implementations§
Source§impl RecordedResponse
impl RecordedResponse
Sourcepub fn ok(body: &str) -> RecordedResponse
pub fn ok(body: &str) -> RecordedResponse
A 200 carrying body, which is what most recorded answers are.
Sourcepub fn new(status: i64, body: &str) -> RecordedResponse
pub fn new(status: i64, body: &str) -> RecordedResponse
A status carrying body.
Trait Implementations§
Source§impl Clone for RecordedResponse
impl Clone for RecordedResponse
Source§fn clone(&self) -> RecordedResponse
fn clone(&self) -> RecordedResponse
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RecordedResponse
impl RefUnwindSafe for RecordedResponse
impl Send for RecordedResponse
impl Sync for RecordedResponse
impl Unpin for RecordedResponse
impl UnsafeUnpin for RecordedResponse
impl UnwindSafe for RecordedResponse
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