pub struct IrohSubstrate { /* private fields */ }Expand description
Two-plane iroh substrate: one shared QUIC endpoint, two ALPN-dispatched protocol handlers.
Drop to abort the accept loop; call IrohSubstrate::shutdown for a
clean shutdown that drains protocol handlers and closes the endpoint.
Implementations§
Source§impl IrohSubstrate
impl IrohSubstrate
Sourcepub async fn new<M, R>(
secret_key_bytes: [u8; 32],
moq_handler: M,
rpc_handler: R,
) -> Result<Self>
pub async fn new<M, R>( secret_key_bytes: [u8; 32], moq_handler: M, rpc_handler: R, ) -> Result<Self>
Build the substrate from raw 32-byte Ed25519 secret key material.
Uses iroh’s presets::N0 for discovery (n0 DNS + pkarr) and relay
fallback. The native carrier remains strict PQ-hybrid; the patched iroh
builder routes only external CA-validated HTTPS through its compatible
provider, so public N0 infrastructure can be reached without weakening
the owned carrier policy.
pkarr here is liveness-only — see the module-level “D3” note. The published record carries reach hints (relay + direct addrs) for this endpoint’s NodeId; it derives zero identity/trust authority. The #385 metadata-leak caveat also applies (mitigated by #361, not by this demotion).
Sourcepub fn endpoint_id(&self) -> EndpointId
pub fn endpoint_id(&self) -> EndpointId
Return this endpoint’s carrier address for reach advertisement and diagnostics. It is not a DID/JWKS key or application identity proof.
Sourcepub fn endpoint(&self) -> &Endpoint
pub fn endpoint(&self) -> &Endpoint
Borrow the underlying endpoint, e.g. to issue outbound connects on an ALPN not served by this substrate’s router.
Sourcepub fn owned_client_endpoint(&self) -> OwnedIrohClientEndpoint
pub fn owned_client_endpoint(&self) -> OwnedIrohClientEndpoint
Clone the endpoint as an owned-provider capability for installation as the shared outbound RPC and MoQ dial endpoint.
Auto Trait Implementations§
impl Freeze for IrohSubstrate
impl !RefUnwindSafe for IrohSubstrate
impl Send for IrohSubstrate
impl Sync for IrohSubstrate
impl Unpin for IrohSubstrate
impl UnsafeUnpin for IrohSubstrate
impl !UnwindSafe for IrohSubstrate
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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