pub struct RefererMiddleware {
pub same_origin_only: bool,
pub max_chain_length: usize,
pub include_fragment: bool,
/* private fields */
}Expand description
Referer middleware that automatically sets Referer headers based on the navigation chain
Fields§
§same_origin_only: boolWhether to use same-origin only referer
max_chain_length: usizeMaximum referer chain length to keep in memory
include_fragment: boolWhether to include fragment in referer URL
Implementations§
Source§impl RefererMiddleware
impl RefererMiddleware
Sourcepub fn same_origin_only(self, same_origin_only: bool) -> Self
pub fn same_origin_only(self, same_origin_only: bool) -> Self
Set whether to use same-origin only referer.
Sourcepub fn max_chain_length(self, max_chain_length: usize) -> Self
pub fn max_chain_length(self, max_chain_length: usize) -> Self
Set the maximum referer chain length to keep in memory.
Sourcepub fn include_fragment(self, include_fragment: bool) -> Self
pub fn include_fragment(self, include_fragment: bool) -> Self
Set whether to include the fragment in the referer URL.
Trait Implementations§
Source§impl Clone for RefererMiddleware
impl Clone for RefererMiddleware
Source§fn clone(&self) -> RefererMiddleware
fn clone(&self) -> RefererMiddleware
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RefererMiddleware
impl Debug for RefererMiddleware
Source§impl Default for RefererMiddleware
impl Default for RefererMiddleware
Source§impl<C: Send + Sync> Middleware<C> for RefererMiddleware
impl<C: Send + Sync> Middleware<C> for RefererMiddleware
fn name(&self) -> &str
fn process_request<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_client: &'life1 C,
request: Request,
) -> Pin<Box<dyn Future<Output = Result<MiddlewareAction<Request>, SpiderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn process_response<'life0, 'async_trait>(
&'life0 mut self,
response: Response,
) -> Pin<Box<dyn Future<Output = Result<MiddlewareAction<Response>, SpiderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_error<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
_request: &'life1 Request,
error: &'life2 SpiderError,
) -> Pin<Box<dyn Future<Output = Result<MiddlewareAction<Request>, SpiderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Auto Trait Implementations§
impl Freeze for RefererMiddleware
impl !RefUnwindSafe for RefererMiddleware
impl Send for RefererMiddleware
impl Sync for RefererMiddleware
impl Unpin for RefererMiddleware
impl !UnwindSafe for RefererMiddleware
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