pub struct EndpointOutput<T> { /* private fields */ }Expand description
A successful call retains the actual value, since after hooks can replace its shape.
Implementations§
Source§impl<T> EndpointOutput<T>
impl<T> EndpointOutput<T>
Sourcepub const fn http_response(&self) -> Option<&AuthResponse>
pub const fn http_response(&self) -> Option<&AuthResponse>
The unforwarded response value, separate from accumulated endpoint headers.
Sourcepub fn into_response(self) -> AuthResult<AuthResponse>
pub fn into_response(self) -> AuthResult<AuthResponse>
Forward the result to HTTP, merging safe hook headers and repeated cookies.
A response value retains its own body and status. A JSON replacement from an after hook is serialized using the endpoint status instead.
§Errors
Returns a serialization error for a JSON result.
pub const fn value(&self) -> &JsValue
pub const fn headers(&self) -> &Headers
pub const fn status(&self) -> Option<u16>
Source§impl<T: DeserializeOwned + 'static> EndpointOutput<T>
impl<T: DeserializeOwned + 'static> EndpointOutput<T>
Sourcepub fn decode(&self) -> AuthResult<T>
pub fn decode(&self) -> AuthResult<T>
§Errors
Returns an error if an application hook replaced the expected output type.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for EndpointOutput<T>
impl<T> RefUnwindSafe for EndpointOutput<T>
impl<T> Send for EndpointOutput<T>
impl<T> Sync for EndpointOutput<T>
impl<T> Unpin for EndpointOutput<T>
impl<T> UnsafeUnpin for EndpointOutput<T>
impl<T> UnwindSafe for EndpointOutput<T>
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