pub struct PostOutcome {
pub status: u16,
pub body: Vec<u8>,
}Expand description
A completed request: what the server said, and what it said it with.
Fields§
§status: u16§body: Vec<u8>The raw body. Public, so the Debug impl below is a default rather
than a barrier: {:?} on this field prints everything. On a success
this holds the access and refresh tokens, so it must not be logged,
formatted into an error, or echoed on any path that is not already known
to be a failure response.
Implementations§
Source§impl PostOutcome
impl PostOutcome
Sourcepub fn json(&self) -> Result<Value>
pub fn json(&self) -> Result<Value>
Parse the body as JSON.
The body is NEVER echoed into the error, not even an excerpt. This is called on the SUCCESSFUL token response, so a 200 that fails to parse — truncated by a proxy, a WAF interstitial appended to JSON — would otherwise put the access and refresh tokens into whatever logs the error. Status and length carry the same diagnostic value.
pub fn is_success(&self) -> bool
Trait Implementations§
Source§impl Debug for PostOutcome
Hand-written, NOT derived. A token-endpoint body holds the access and refresh
tokens; a derived Debug would put them into any log line, panic message or
{:?} that ever touches this value.
impl Debug for PostOutcome
Hand-written, NOT derived. A token-endpoint body holds the access and refresh
tokens; a derived Debug would put them into any log line, panic message or
{:?} that ever touches this value.
Auto Trait Implementations§
impl Freeze for PostOutcome
impl RefUnwindSafe for PostOutcome
impl Send for PostOutcome
impl Sync for PostOutcome
impl Unpin for PostOutcome
impl UnsafeUnpin for PostOutcome
impl UnwindSafe for PostOutcome
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more