Skip to main content

evaluate

Function evaluate 

Source
pub fn evaluate(
    script: &PacScript,
    url: &Url,
    policy: &PacPolicy,
) -> Result<Vec<ProxyStep>, Error>
Available on crate feature pac only.
Expand description

Evaluate script for url under policy (sanitize_url first).

pac-boa is the only engine this reaches, whatever else is enabled — turning on pac-windows-native as well adds WinHttpPacResolver for the caller to drive, not a second engine for this function to choose between.

A URL with no host (data:, mailto:) is still evaluated, with host empty — resolve_with_pac and WinHttpPacResolver::resolve_config answer Direct for those without running anything. This is the engine door, not a routing entry point.

§Errors

Error::PacEngineUnavailable with no engine, else PacEvaluator::evaluate.