pub struct CallResponse<Out = Value> { /* private fields */ }Expand description
A successful (2xx) response, tagged with the action’s default output type
Out (the io_schema output, or Value for raw calls). Holds the raw
body; CallResponse::output decodes the default, CallResponse::json
any caller type.
Implementations§
Source§impl<Out> CallResponse<Out>
impl<Out> CallResponse<Out>
Sourcepub fn status(&self) -> StatusCode
pub fn status(&self) -> StatusCode
The HTTP status of the response.
Sourcepub fn headers(&self) -> &BTreeMap<String, String>
pub fn headers(&self) -> &BTreeMap<String, String>
The response headers (rate-limit, request-id, ETag, Link, …), header
names mapped to their value.
Sourcepub fn json<T: DeserializeOwned>(&self) -> Result<T, Error>
pub fn json<T: DeserializeOwned>(&self) -> Result<T, Error>
Decodes the body into a caller-supplied type — the override for when the synced output is wrong.
Source§impl<Out: DeserializeOwned> CallResponse<Out>
impl<Out: DeserializeOwned> CallResponse<Out>
Trait Implementations§
Auto Trait Implementations§
impl<Out = Value> !Freeze for CallResponse<Out>
impl<Out> Forget for CallResponse<Out>
impl<Out> Move for CallResponse<Out>
impl<Out> RefUnwindSafe for CallResponse<Out>
impl<Out> Send for CallResponse<Out>
impl<Out> Sync for CallResponse<Out>
impl<Out> Unpin for CallResponse<Out>
impl<Out> UnsafeUnpin for CallResponse<Out>where
NonZeroU16Inner: UnsafeUnpin,
*const LeafNode<String, String> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, String)>>: UnsafeUnpin,
*const u8: UnsafeUnpin,
Align8<*mut ()>: UnsafeUnpin,
&'static Vtable: UnsafeUnpin,
PhantomData<fn() -> Out>: UnsafeUnpin,
impl<Out> UnwindSafe for CallResponse<Out>where
NonZero<u16>: UnwindSafe,
BTreeMap<String, String>: UnwindSafe,
*const u8: UnwindSafe,
Align8<*mut ()>: UnwindSafe,
&'static Vtable: UnwindSafe,
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