pub struct Request {
pub method: String,
pub path: String,
pub headers: HashMap<String, String>,
pub body: String,
}Expand description
A parsed request. Headers are lowercased on the way in, because HTTP header names are case-insensitive and half of the clients disagree about casing.
Fields§
§method: String§path: String§headers: HashMap<String, String>§body: StringImplementations§
Source§impl Request
impl Request
pub fn header(&self, name: &str) -> Option<&str>
Sourcepub fn wants_stream(&self) -> bool
pub fn wants_stream(&self) -> bool
Does the body ask for a streamed response? Streaming changes how the proxy relays: a buffered read would hold every token until the model finished, turning a live stream into a long pause and a wall of text.
Trait Implementations§
impl Eq for Request
impl StructuralPartialEq for Request
Auto Trait Implementations§
impl Freeze for Request
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnsafeUnpin for Request
impl UnwindSafe for Request
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