Skip to main content

QuicLoopConfig

Struct QuicLoopConfig 

Source
pub struct QuicLoopConfig {
Show 15 fields pub announcement_cancellation: CancellationToken, pub cert_chain: Vec<Vec<u8>>, pub key_der: Zeroizing<Vec<u8>>, pub bind_addr: SocketAddr, pub server_name: String, pub protected_resource_json: Option<Vec<u8>>, pub on_quic_bound: Option<Box<dyn FnOnce(String, SocketAddr, String) + Send>>, pub iroh_enabled: bool, pub iroh_required: bool, pub on_iroh_bound: Option<Box<dyn FnOnce(String, [u8; 32]) -> Result<()> + Send>>, pub moq_relay: Option<TransportConfig>, pub moq_relay_server_identity: Option<MoqlServerIdentity>, pub moq_admission: Option<Arc<MoqlAdmissionAuthenticator>>, pub moq_ingress_authorizer: Option<SharedIngressAuthorizer>, pub moq_admission_proof: Option<MoqlAdmissionProof>,
}
Expand description

REQ/REP message loop for RequestService.

Runs the REQ/REP message loop as an async task with TMQ for I/O. Uses proper async/await with epoll integration instead of blocking threads.

§Envelope Verification

The loop unwraps and verifies SignedEnvelope for every request:

  1. Deserialize SignedEnvelope from wire bytes
  2. Verify Ed25519 signature against server’s public key
  3. Check nonce not replayed (replay protection)
  4. Extract EnvelopeContext and dispatch to handler

Invalid/unsigned requests are rejected with an error response.

§Usage

QUIC server configuration for the service loop.

Fields§

§announcement_cancellation: CancellationToken

Cancels all announcements owned by this bound service before teardown.

§cert_chain: Vec<Vec<u8>>

DER-encoded certificate chain (leaf first, then intermediates/CA)

§key_der: Zeroizing<Vec<u8>>

DER-encoded private key — zeroed on drop.

§bind_addr: SocketAddr

Address to bind the WebTransport server

§server_name: String

TLS server name (for endpoint discovery registration)

§protected_resource_json: Option<Vec<u8>>

Pre-serialized RFC 9728 JSON for HTTP/3 .well-known/oauth-protected-resource

§on_quic_bound: Option<Box<dyn FnOnce(String, SocketAddr, String) + Send>>

Callback invoked after QUIC binding succeeds, with (service_name, actual_addr, server_name). Used to announce endpoints to the DiscoveryService.

§iroh_enabled: bool

#410/#282: when true (the default), the spawner binds an IrohSubstrate as the PRIMARY production endpoint, serving BOTH ALPNs (hyprstream-rpc/1 + moql) with the same request processor + moq origin, and installs the shared client endpoint for outbound iroh dials. The quinn endpoint is bound in parallel for back-compat. Native-only. Set false (via [quic] iroh = false) to run quinn-only (legacy).

§iroh_required: bool

Iroh is a startup/readiness requirement for native traffic. Quinn may still serve the browser edge but cannot satisfy this native contract.

§on_iroh_bound: Option<Box<dyn FnOnce(String, [u8; 32]) -> Result<()> + Send>>

#282: callback invoked after the iroh substrate binds, with (service_name, node_id) where node_id is the endpoint’s 32-byte Ed25519 public carrier address. Used to advertise only an IrohTransport service entry when bound; it must never become a verification method.

§moq_relay: Option<TransportConfig>

#358: the producer-chosen moq RELAY this node rendezvouses through, in wire-reach form (crate::stream_info::TransportConfig). When set, the spawner places it in the service’s ProducerReachConfig (so published streams advertise a Role::Relay reach) and links this node’s streaming origin UP to the relay (crate::moq_stream::serve_origin_to_relay_background) — restoring the rendezvous property: neither publisher nor subscriber need be directly reachable by the other. Sourced from the resolved relay DID transport entry (default: the PDS / federation anchor) decoded by the shared crate::service_entry codec, so the stream relay and DID addresses never drift. None = direct-only (the S1/S2 behaviour). Native-only.

§moq_relay_server_identity: Option<MoqlServerIdentity>

Resolver-verified accepted-state witness for moq_relay. Iroh relay links require this distinct remote identity for mutual admission.

§moq_admission: Option<Arc<MoqlAdmissionAuthenticator>>

#1027: optional inside-carrier admission authenticator for the iroh moql accept path. When set, every accepted moql connection must prove an accepted current Ed25519 + ML-DSA-65 identity (fresh challenge/response binding epoch/head/nonces) before the moq handshake; the admitted peer is served only its resolved tenant’s scope. When None, the pre-#1027 posture stands: anonymous carriers are refused. Native-only.

§moq_ingress_authorizer: Option<SharedIngressAuthorizer>

Optional service-owned ingress authorization. The spawner forwards it unchanged to the Iroh MoQL handler; absence is deliberately read-only.

§moq_admission_proof: Option<MoqlAdmissionProof>

Native client proof for authenticated Iroh moql dials in this process.

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T> ServiceExt for T

§

fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>
where Self: Sized,

Apply a transformation to the response body. Read more
§

fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using HTTP status codes. Read more
§

fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using gRPC headers. Read more
§

fn follow_redirects(self) -> FollowRedirect<Self>
where Self: Sized,

Follow redirect resposes using the Standard policy. Read more
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSend for T
where T: Send,

§

impl<T> MaybeSend for T
where T: Send,