pub trait RobotsPolicyGuard: Send + Sync {
// Required methods
fn name(&self) -> &'static str;
fn decide<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<RobotsDecision>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Port trait: ask a guard whether a URL is permitted under the
configured RobotsPolicy.
Adapters must be Send + Sync so they can be stored in an Arc and
shared between the recon path and the production path. The guard is
invoked at pipeline-build time (so forbidden URLs surface before any
production traffic) and again at execute time (so policy drift
between spec-build and run is caught).
Required Methods§
Sourcefn name(&self) -> &'static str
fn name(&self) -> &'static str
Stable name for diagnostics — usually the upstream source
("manual", "robots_txt", "cached").
Sourcefn decide<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<RobotsDecision>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn decide<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<RobotsDecision>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Decide whether a single URL may be fetched.
§Errors
Returns crate::domain::error::GraphError::ExecutionFailed if the guard cannot reach
its data source (e.g. network failure during a live
robots.txt lookup).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".