Struct HttpResponse
pub struct HttpResponse { /* private fields */ }
Expand description
A HttpResponse is used to wrap the memory returned by
extism_pdk::http::request
Implementations§
§impl HttpResponse
impl HttpResponse
pub fn into_memory(self) -> Memory
pub fn status_code(&self) -> u16
pub fn as_memory(&self) -> &Memory
pub fn body(&self) -> Vec<u8>
pub fn json<T>(&self) -> Result<T, Error>where
T: DeserializeOwned,
pub fn headers(&self) -> &HashMap<String, String>
pub fn header(&self, s: impl AsRef<str>) -> Option<&str>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HttpResponse
impl RefUnwindSafe for HttpResponse
impl Send for HttpResponse
impl Sync for HttpResponse
impl Unpin for HttpResponse
impl UnwindSafe for HttpResponse
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