Skip to main content

Engine

Struct Engine 

Source
pub struct Engine { /* private fields */ }
Expand description

Thread-safe deterministic browser engine.

Implementations§

Source§

impl Engine

Source

pub fn new(config: EngineConfig) -> Self

Create an engine from a checked configuration.

Source

pub fn from_persisted( runtime_session: [u8; 16], network: Network, policy: &[u8], ) -> Result<Self, EngineError>

Create from a versioned persisted policy blob.

Source

pub fn snapshot(&self) -> Result<EngineSnapshot, EngineError>

Read structured status.

Source

pub fn export_policy(&self) -> Result<[u8; 32], EngineError>

Export the exact persistent policy representation.

Source

pub fn transport_plan(&self) -> Result<TransportPlan, EngineError>

Read the direct-authoritative-first current plan.

Source

pub fn begin_gateway( &self, limits: GatewayLimits, ) -> Result<Gateway, EngineError>

Begin one bounded fail-closed transport gateway under current policy.

Source

pub fn observability_status( &self, runtime: ObservabilityRuntime, ) -> Result<BrowserStatus, EngineError>

Produce the complete, bounded shared browser status.

Source

pub fn update_policy( &self, expected_policy_generation: u64, next: PolicyConfig, ) -> Result<PolicyTransition, EngineError>

Replace policy and increment runtime generation when it changes.

Source

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.

Source

pub fn advance_authority_state( &self, next: AuthorityState, ) -> Result<EngineSnapshot, EngineError>

Advance the explicit authority state machine.

Source

pub fn admit_resolution( &self, transport: ResolutionTransport, query: Query, ) -> Result<ResolutionAttempt, EngineError>

Admit one exact query on one current transport.

Source

pub fn parse_response( &self, attempt: &ResolutionAttempt, response: &[u8], limits: ParseLimits, ) -> Result<ParsedResponse, EngineError>

Parse and correlate transport bytes, rejecting revoked generations.

Source

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.

Source

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.

Source

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.

Source

pub fn authorize_browser_bridge( &self, completion: &DaneCompletion, now: u64, ) -> Result<BrowserBridgeAuthorization, EngineError>

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.

Trait Implementations§

Source§

impl Debug for Engine

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.