pub struct ScriptedRequest {
pub method: String,
pub path: String,
pub body: String,
}Expand description
One request a fake listener hands to the program, as a test wrote it.
Fields§
§method: StringGet or Post, the case name of http.Method.
path: StringThe path, such as /health.
body: StringThe request body, which is empty for a Get.
Implementations§
Source§impl ScriptedRequest
impl ScriptedRequest
Sourcepub fn get(path: &str) -> ScriptedRequest
pub fn get(path: &str) -> ScriptedRequest
A Get of path with no body.
Sourcepub fn post(path: &str, body: &str) -> ScriptedRequest
pub fn post(path: &str, body: &str) -> ScriptedRequest
A Post of body to path.
Trait Implementations§
Source§impl Clone for ScriptedRequest
impl Clone for ScriptedRequest
Source§fn clone(&self) -> ScriptedRequest
fn clone(&self) -> ScriptedRequest
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 ScriptedRequest
impl RefUnwindSafe for ScriptedRequest
impl Send for ScriptedRequest
impl Sync for ScriptedRequest
impl Unpin for ScriptedRequest
impl UnsafeUnpin for ScriptedRequest
impl UnwindSafe for ScriptedRequest
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