pub struct ResponseStub {
pub method: String,
pub path: String,
pub status: u16,
pub headers: HashMap<String, String>,
pub body: Value,
pub latency_ms: Option<u64>,
}Expand description
A response stub for mocking API endpoints
Fields§
§method: StringHTTP method (GET, POST, PUT, DELETE, etc.)
path: StringPath pattern (supports {{path_params}})
status: u16HTTP status code
headers: HashMap<String, String>Response headers
body: ValueResponse body (supports templates like {{uuid}}, {{faker.name}})
latency_ms: Option<u64>Optional latency in milliseconds
Implementations§
Trait Implementations§
Source§impl Clone for ResponseStub
impl Clone for ResponseStub
Source§fn clone(&self) -> ResponseStub
fn clone(&self) -> ResponseStub
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ResponseStub
impl Debug for ResponseStub
Source§impl<'de> Deserialize<'de> for ResponseStub
impl<'de> Deserialize<'de> for ResponseStub
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ResponseStub
impl RefUnwindSafe for ResponseStub
impl Send for ResponseStub
impl Sync for ResponseStub
impl Unpin for ResponseStub
impl UnwindSafe for ResponseStub
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