pub struct MoqStreamOrigin { /* private fields */ }Expand description
Shared moq origin for the streaming plane, plus the in-process publish gate.
Holds the OriginProducer (what in-process publishers append into) and the
OriginConsumer (handed to moq_net::Server to serve external subscribers).
This is the moq replacement for [crate::service::StreamService]’s ZMQ
proxy: there is no forwarding loop — producers and consumers share one tree.
Implementations§
Source§impl MoqStreamOrigin
impl MoqStreamOrigin
Sourcepub fn builder(
producer: OriginProducer,
consumer: OriginConsumer,
) -> MoqStreamOriginBuilder
pub fn builder( producer: OriginProducer, consumer: OriginConsumer, ) -> MoqStreamOriginBuilder
Begin building from an existing producer/consumer pair (e.g. the one
held by crate::transport::iroh_moq::IrohMoqProtocolHandler).
Sourcepub fn from_pair(producer: OriginProducer, consumer: OriginConsumer) -> Self
pub fn from_pair(producer: OriginProducer, consumer: OriginConsumer) -> Self
Build directly from a producer/consumer pair with defaults.
Sourcepub fn standalone() -> MoqStreamOriginBuilder
pub fn standalone() -> MoqStreamOriginBuilder
Begin building a standalone origin with a fresh random id.
Used when no shared substrate origin is available yet (M2a bootstrap).
Callers that have the substrate’s IrohMoqProtocolHandler should use
Self::builder with its origin_producer() / origin_consumer()
instead, so external subscribers see the same tree.
Sourcepub fn consumer(&self) -> &OriginConsumer
pub fn consumer(&self) -> &OriginConsumer
Borrow the consumer (hand this to moq_net::Server::with_publish).
Check the in-process publish gate for a signer pubkey.
Returns true when no gate is installed (bootstrap/testing).
Sourcepub fn broadcast_path(&self, topic: &str) -> String
pub fn broadcast_path(&self, topic: &str) -> String
Build the broadcast path for an opaque topic: {prefix}/{topic}.
Sourcepub fn publisher(&self, ctx: &StreamContext) -> Result<MoqStreamPublisher>
pub fn publisher(&self, ctx: &StreamContext) -> Result<MoqStreamPublisher>
Create an in-process publisher for ctx’s topic.
Creates (or replaces) the broadcast at {prefix}/{topic} with a single
STREAM_TRACK track, and returns a MoqStreamPublisher whose
chained-HMAC state is seeded from ctx.mac_key() / ctx.topic() — i.e.
byte-identical to the ZMQ StreamBuilder.
Sourcepub fn publisher_with_provenance(
&self,
ctx: &StreamContext,
provenance: Option<ProvenanceSigner>,
) -> Result<MoqStreamPublisher>
pub fn publisher_with_provenance( &self, ctx: &StreamContext, provenance: Option<ProvenanceSigner>, ) -> Result<MoqStreamPublisher>
Create an in-process publisher that additionally signs each StreamBlock with the node’s per-host hybrid COSE identity (#321 provenance / C-PROV).
provenance = Some(signer) attaches a StreamBlock.provenance signature
so consumers can attribute each block to the producing host (threat T3);
None keeps the legacy chained-HMAC-only block.
Trait Implementations§
Source§impl Clone for MoqStreamOrigin
impl Clone for MoqStreamOrigin
Source§fn clone(&self) -> MoqStreamOrigin
fn clone(&self) -> MoqStreamOrigin
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for MoqStreamOrigin
impl !RefUnwindSafe for MoqStreamOrigin
impl Send for MoqStreamOrigin
impl Sync for MoqStreamOrigin
impl Unpin for MoqStreamOrigin
impl UnsafeUnpin for MoqStreamOrigin
impl !UnwindSafe for MoqStreamOrigin
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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