pub enum ResponseHandler {
Body,
Header(StringSource),
Url,
Cookie(StringSource),
}Expand description
What part of a response a RequestConfig should return.
Defaults to Self::Body.
Variants§
Body
Get the response body.
§Errors
If the call to reqwest::blocking::Response::text returns an error, that error is returned.
Header(StringSource)
Get the specified header.
§Errors
If the call to StringSource::get returns an error, that error is returned.
If the call to StringSource::get returns None, returns the error ResponseHandlerError::StringSourceIsNone.
If the header isn’t found, returns the error ResponseHandlerError::HeaderNotFound.
If the call to HeaderValue::to_str returns an error, that error is returned.
Url
Get the final URL.
Cookie(StringSource)
Get the specified cookie.
§Errors
If the call to StringSource::get returns an error, that error is returned.
If the call to StringSource::get returns None, returns the error ResponseHandlerError::CookieNotFound.
Implementations§
Source§impl ResponseHandler
impl ResponseHandler
Sourcepub fn handle(
&self,
response: Response,
task_state: &TaskStateView<'_>,
) -> Result<String, ResponseHandlerError>
pub fn handle( &self, response: Response, task_state: &TaskStateView<'_>, ) -> Result<String, ResponseHandlerError>
Gets the specified part of a reqwest::blocking::Response.
§Errors
See each variant of Self for when each variant returns an error.
Trait Implementations§
Source§impl Clone for ResponseHandler
impl Clone for ResponseHandler
Source§fn clone(&self) -> ResponseHandler
fn clone(&self) -> ResponseHandler
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResponseHandler
impl Debug for ResponseHandler
Source§impl Default for ResponseHandler
impl Default for ResponseHandler
Source§fn default() -> ResponseHandler
fn default() -> ResponseHandler
Source§impl<'de> Deserialize<'de> for ResponseHandler
impl<'de> Deserialize<'de> for ResponseHandler
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ResponseHandler
impl PartialEq for ResponseHandler
Source§impl Serialize for ResponseHandler
impl Serialize for ResponseHandler
impl Eq for ResponseHandler
impl StructuralPartialEq for ResponseHandler
Auto Trait Implementations§
impl Freeze for ResponseHandler
impl RefUnwindSafe for ResponseHandler
impl Send for ResponseHandler
impl Sync for ResponseHandler
impl Unpin for ResponseHandler
impl UnwindSafe for ResponseHandler
Blanket Implementations§
Source§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
Source§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read moreSource§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL modifier for aggregate functions Read moreSource§fn aggregate_filter<P>(self, f: P) -> Self::Output
fn aggregate_filter<P>(self, f: P) -> Self::Output
Source§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
&self to an expression for Diesel’s query builder. Read more