#[non_exhaustive]pub enum SmartContext {
Http(HtmlContext),
Browser(BrowserContext),
}Expand description
A context produced by either the HTTP/HTML or browser execution path.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Http(HtmlContext)
Successful HTTP response with parsed HTML.
Browser(BrowserContext)
Browser-rendered page.
Implementations§
Source§impl SmartContext
impl SmartContext
Sourcepub fn enqueue(&self) -> &EnqueueLinker
pub fn enqueue(&self) -> &EnqueueLinker
Returns this context’s URL-enqueue helper.
Sourcepub fn storage(&self) -> &StorageHandle
pub fn storage(&self) -> &StorageHandle
Returns this context’s open storage handles.
Sourcepub fn crawler(&self) -> &CrawlerHandle
pub fn crawler(&self) -> &CrawlerHandle
Returns the weak handle to the running crawler.
Sourcepub fn as_http(&self) -> Option<&HtmlContext>
pub fn as_http(&self) -> Option<&HtmlContext>
Borrows the HTTP context when this request stayed on the HTTP path.
Sourcepub fn as_browser(&self) -> Option<&BrowserContext>
pub fn as_browser(&self) -> Option<&BrowserContext>
Borrows the browser context when this request was promoted.
Sourcepub fn is_browser(&self) -> bool
pub fn is_browser(&self) -> bool
Returns whether this request executed through a browser.
Trait Implementations§
Source§impl Clone for SmartContext
impl Clone for SmartContext
Source§fn clone(&self) -> SmartContext
fn clone(&self) -> SmartContext
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 moreSource§impl Debug for SmartContext
impl Debug for SmartContext
Source§impl HasRequest for SmartContext
impl HasRequest for SmartContext
Auto Trait Implementations§
impl !RefUnwindSafe for SmartContext
impl !UnwindSafe for SmartContext
impl Freeze for SmartContext
impl Send for SmartContext
impl Sync for SmartContext
impl Unpin for SmartContext
impl UnsafeUnpin for SmartContext
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