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>,
}
Expand description
Request context for prompt template expansion
Fields§
§method: String
HTTP method (GET, POST, etc.)
path: String
Request path
path_params: HashMap<String, Value>
Path parameters
query_params: HashMap<String, Value>
Query parameters
headers: HashMap<String, Value>
Request headers
body: Option<Value>
Request body (if JSON)
Implementations§
Source§impl RequestContext
impl RequestContext
Sourcepub fn with_path_params(self, params: HashMap<String, Value>) -> Self
pub fn with_path_params(self, params: HashMap<String, Value>) -> Self
Set path parameters
Sourcepub fn with_query_params(self, params: HashMap<String, Value>) -> Self
pub fn with_query_params(self, params: HashMap<String, Value>) -> Self
Set query parameters
Sourcepub fn with_headers(self, headers: HashMap<String, Value>) -> Self
pub fn with_headers(self, headers: HashMap<String, Value>) -> Self
Set headers
Trait Implementations§
Source§impl Clone for RequestContext
impl Clone for RequestContext
Source§fn clone(&self) -> RequestContext
fn clone(&self) -> RequestContext
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 RequestContext
impl Debug for RequestContext
Source§impl Default for RequestContext
impl Default for RequestContext
Source§fn default() -> RequestContext
fn default() -> RequestContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RequestContext
impl RefUnwindSafe for RequestContext
impl Send for RequestContext
impl Sync for RequestContext
impl Unpin 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
Mutably borrows from an owned value. Read more