pub struct Engine { /* private fields */ }Expand description
Thread-safe deterministic browser engine.
Implementations§
Source§impl Engine
impl Engine
Sourcepub fn new(config: EngineConfig) -> Self
pub fn new(config: EngineConfig) -> Self
Create an engine from a checked configuration.
Sourcepub fn from_persisted(
runtime_session: [u8; 16],
network: Network,
policy: &[u8],
) -> Result<Self, EngineError>
pub fn from_persisted( runtime_session: [u8; 16], network: Network, policy: &[u8], ) -> Result<Self, EngineError>
Create from a versioned persisted policy blob.
Sourcepub fn snapshot(&self) -> Result<EngineSnapshot, EngineError>
pub fn snapshot(&self) -> Result<EngineSnapshot, EngineError>
Read structured status.
Sourcepub fn export_policy(&self) -> Result<[u8; 32], EngineError>
pub fn export_policy(&self) -> Result<[u8; 32], EngineError>
Export the exact persistent policy representation.
Sourcepub fn transport_plan(&self) -> Result<TransportPlan, EngineError>
pub fn transport_plan(&self) -> Result<TransportPlan, EngineError>
Read the direct-authoritative-first current plan.
Sourcepub fn begin_gateway(
&self,
limits: GatewayLimits,
) -> Result<Gateway, EngineError>
pub fn begin_gateway( &self, limits: GatewayLimits, ) -> Result<Gateway, EngineError>
Begin one bounded fail-closed transport gateway under current policy.
Sourcepub fn observability_status(
&self,
runtime: ObservabilityRuntime,
) -> Result<BrowserStatus, EngineError>
pub fn observability_status( &self, runtime: ObservabilityRuntime, ) -> Result<BrowserStatus, EngineError>
Produce the complete, bounded shared browser status.
Sourcepub fn update_policy(
&self,
expected_policy_generation: u64,
next: PolicyConfig,
) -> Result<PolicyTransition, EngineError>
pub fn update_policy( &self, expected_policy_generation: u64, next: PolicyConfig, ) -> Result<PolicyTransition, EngineError>
Replace policy and increment runtime generation when it changes.
Sourcepub fn update_policy_blob(
&self,
expected_policy_generation: u64,
blob: &[u8],
) -> Result<PolicyTransition, EngineError>
pub fn update_policy_blob( &self, expected_policy_generation: u64, blob: &[u8], ) -> Result<PolicyTransition, EngineError>
Replace policy from a persistence blob whose generation must match.
Advance the explicit authority state machine.
Sourcepub fn admit_resolution(
&self,
transport: ResolutionTransport,
query: Query,
) -> Result<ResolutionAttempt, EngineError>
pub fn admit_resolution( &self, transport: ResolutionTransport, query: Query, ) -> Result<ResolutionAttempt, EngineError>
Admit one exact query on one current transport.
Sourcepub fn parse_response(
&self,
attempt: &ResolutionAttempt,
response: &[u8],
limits: ParseLimits,
) -> Result<ParsedResponse, EngineError>
pub fn parse_response( &self, attempt: &ResolutionAttempt, response: &[u8], limits: ParseLimits, ) -> Result<ParsedResponse, EngineError>
Parse and correlate transport bytes, rejecting revoked generations.
Sourcepub fn admit_gateway_selection(
&self,
selection: GatewaySelection,
query: Query,
limits: ParseLimits,
) -> Result<GatewayResolution, EngineError>
pub fn admit_gateway_selection( &self, selection: GatewaySelection, query: Query, limits: ParseLimits, ) -> Result<GatewayResolution, EngineError>
Atomically admit a gateway selection under the current policy/runtime.
Response bytes are parsed and exactly correlated before an engine event is consumed. The selection’s policy generation, selected transport, identities, and privacy-downgrade state are then admitted together under one write lock, so callers cannot substitute completion context.
Sourcepub fn complete_resolution_with_local_dane(
&self,
attempt: &ResolutionAttempt,
response: &ParsedResponse,
prerequisites: LocalDanePrerequisites,
certificate_der: &[u8],
limits: DaneLimits,
context: CompletionContext,
) -> Result<DaneCompletion, EngineError>
pub fn complete_resolution_with_local_dane( &self, attempt: &ResolutionAttempt, response: &ParsedResponse, prerequisites: LocalDanePrerequisites, certificate_der: &[u8], limits: DaneLimits, context: CompletionContext, ) -> Result<DaneCompletion, EngineError>
Complete a TLSA response after matching its RRset to the leaf certificate.
The query must be an exact class-IN TLSA query. Only same-owner TLSA answers from the already correlated response are considered; CNAME chasing and fallback trust paths are intentionally absent.
Sourcepub fn complete_resolution_with_validated_tlsa(
&self,
attempt: &ResolutionAttempt,
response: &ParsedResponse,
input: ValidatedDaneInput<'_>,
context: CompletionContext,
) -> Result<DaneCompletion, EngineError>
pub fn complete_resolution_with_validated_tlsa( &self, attempt: &ResolutionAttempt, response: &ParsedResponse, input: ValidatedDaneInput<'_>, context: CompletionContext, ) -> Result<DaneCompletion, EngineError>
Complete from non-forgeable local DNSSEC/TLSA evidence.
The terminal response must carry the exact RRset represented by
validated. The supplied origin SNI must equal the original TLSA base
domain. DANE-EE or DANE-TA matching is then performed locally with no
WebPKI fallback.
Authorize the exact strict-path origin for the browser bridge.
The completion must still be this engine’s latest current-generation provenance. Legacy caller-prerequisite completions cannot mint a bridge authorization because they carry no engine-verified origin binding.