pub struct FunctionResponse { /* private fields */ }Expand description
Response from an Edge Function invocation.
Implementations§
Source§impl FunctionResponse
impl FunctionResponse
Sourcepub fn header(&self, name: &str) -> Option<&str>
pub fn header(&self, name: &str) -> Option<&str>
Get a specific response header (case-insensitive lookup).
Sourcepub fn json<T: DeserializeOwned>(&self) -> Result<T, FunctionsError>
pub fn json<T: DeserializeOwned>(&self) -> Result<T, FunctionsError>
Deserialize the response body as JSON.
Sourcepub fn text(&self) -> Result<String, FunctionsError>
pub fn text(&self) -> Result<String, FunctionsError>
Get the response body as a UTF-8 string.
Sourcepub fn into_bytes(self) -> Vec<u8> ⓘ
pub fn into_bytes(self) -> Vec<u8> ⓘ
Consume the response and return the body bytes.
Sourcepub fn content_type(&self) -> Option<&str>
pub fn content_type(&self) -> Option<&str>
Get the Content-Type header value.
Trait Implementations§
Source§impl Clone for FunctionResponse
impl Clone for FunctionResponse
Source§fn clone(&self) -> FunctionResponse
fn clone(&self) -> FunctionResponse
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 moreAuto Trait Implementations§
impl Freeze for FunctionResponse
impl RefUnwindSafe for FunctionResponse
impl Send for FunctionResponse
impl Sync for FunctionResponse
impl Unpin for FunctionResponse
impl UnsafeUnpin for FunctionResponse
impl UnwindSafe for FunctionResponse
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