pub struct ResponseValidator(/* private fields */);Expand description
Optional callback to decide whether the token endpoint response is successful.
Receives the HTTP status code and returns true if the response should
be treated as successful. When not provided, the default check is
status.is_success() (i.e. 2xx).
§Example
use faucet_source_rest::ResponseValidator;
// Accept 200 and 201 only:
let validator = ResponseValidator::new(|status| status == 200 || status == 201);
// Accept anything below 400:
let validator = ResponseValidator::new(|status| status < 400);Implementations§
Trait Implementations§
Source§impl Clone for ResponseValidator
impl Clone for ResponseValidator
Source§fn clone(&self) -> ResponseValidator
fn clone(&self) -> ResponseValidator
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ResponseValidator
impl !RefUnwindSafe for ResponseValidator
impl Send for ResponseValidator
impl Sync for ResponseValidator
impl Unpin for ResponseValidator
impl UnsafeUnpin for ResponseValidator
impl !UnwindSafe for ResponseValidator
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