pub struct RequestContext {
pub method: String,
pub path: String,
pub path_params: HashMap<String, Value>,
pub query_params: HashMap<String, Value>,
pub headers: HashMap<String, Value>,
pub body: Option<Value>,
pub multipart_fields: HashMap<String, Value>,
pub multipart_files: HashMap<String, String>,
}Will be extracted to mockforge-intelligence crate
Expand description
Request context for prompt template expansion
Fieldsยง
ยงmethod: StringWill be extracted to mockforge-intelligence crate
HTTP method (GET, POST, etc.)
path: StringWill be extracted to mockforge-intelligence crate
Request path
path_params: HashMap<String, Value>Will be extracted to mockforge-intelligence crate
Path parameters
query_params: HashMap<String, Value>Will be extracted to mockforge-intelligence crate
Query parameters
headers: HashMap<String, Value>Will be extracted to mockforge-intelligence crate
Request headers
body: Option<Value>Will be extracted to mockforge-intelligence crate
Request body (if JSON)
multipart_fields: HashMap<String, Value>Will be extracted to mockforge-intelligence crate
Multipart form fields (for multipart/form-data requests)
multipart_files: HashMap<String, String>Will be extracted to mockforge-intelligence crate
Multipart file uploads (filename -> file path)
Implementationsยง
Sourceยงimpl RequestContext
impl RequestContext
Sourcepub fn new(method: String, path: String) -> Self
๐Deprecated: Will be extracted to mockforge-intelligence crate
pub fn new(method: String, path: String) -> Self
Will be extracted to mockforge-intelligence crate
Create a new request context
Sourcepub fn with_path_params(self, params: HashMap<String, Value>) -> Self
๐Deprecated: Will be extracted to mockforge-intelligence crate
pub fn with_path_params(self, params: HashMap<String, Value>) -> Self
Will be extracted to mockforge-intelligence crate
Set path parameters
Sourcepub fn with_query_params(self, params: HashMap<String, Value>) -> Self
๐Deprecated: Will be extracted to mockforge-intelligence crate
pub fn with_query_params(self, params: HashMap<String, Value>) -> Self
Will be extracted to mockforge-intelligence crate
Set query parameters
Sourcepub fn with_headers(self, headers: HashMap<String, Value>) -> Self
๐Deprecated: Will be extracted to mockforge-intelligence crate
pub fn with_headers(self, headers: HashMap<String, Value>) -> Self
Will be extracted to mockforge-intelligence crate
Set headers
Sourcepub fn with_body(self, body: Value) -> Self
๐Deprecated: Will be extracted to mockforge-intelligence crate
pub fn with_body(self, body: Value) -> Self
Will be extracted to mockforge-intelligence crate
Set body
Sourcepub fn with_multipart_fields(self, fields: HashMap<String, Value>) -> Self
๐Deprecated: Will be extracted to mockforge-intelligence crate
pub fn with_multipart_fields(self, fields: HashMap<String, Value>) -> Self
Will be extracted to mockforge-intelligence crate
Set multipart form fields
Sourcepub fn with_multipart_files(self, files: HashMap<String, String>) -> Self
๐Deprecated: Will be extracted to mockforge-intelligence crate
pub fn with_multipart_files(self, files: HashMap<String, String>) -> Self
Will be extracted to mockforge-intelligence crate
Set multipart file uploads
Trait Implementationsยง
Sourceยงimpl Clone for RequestContext
impl Clone for RequestContext
Sourceยงfn clone(&self) -> RequestContext
fn clone(&self) -> RequestContext
1.0.0 ยท Sourceยงfn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSourceยงimpl Debug for RequestContext
impl Debug for RequestContext
Sourceยงimpl Default for RequestContext
impl Default for RequestContext
Sourceยงfn default() -> RequestContext
fn default() -> RequestContext
Auto Trait Implementationsยง
impl Freeze for RequestContext
impl RefUnwindSafe for RequestContext
impl Send for RequestContext
impl Sync for RequestContext
impl Unpin for RequestContext
impl UnsafeUnpin for RequestContext
impl UnwindSafe for RequestContext
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
Sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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 more