pub struct Request { /* private fields */ }Expand description
An incoming MoQ session that can be accepted or rejected.
Self::with_publish and Self::with_consume will configure what will be published and consumed from the session respectively. Otherwise, the Server’s configuration is used by default.
Implementations§
Source§impl Request
impl Request
Sourcepub async fn close(self, _code: u16) -> Result<()>
pub async fn close(self, _code: u16) -> Result<()>
Reject the session, returning your favorite HTTP status code.
Sourcepub fn with_publish(self, publish: impl Into<Option<OriginConsumer>>) -> Self
pub fn with_publish(self, publish: impl Into<Option<OriginConsumer>>) -> Self
Publish the given origin to the session.
Sourcepub fn with_consume(self, consume: impl Into<Option<OriginProducer>>) -> Self
pub fn with_consume(self, consume: impl Into<Option<OriginProducer>>) -> Self
Consume the given origin from the session.
Sourcepub fn with_stats(self, stats: StatsHandle) -> Self
pub fn with_stats(self, stats: StatsHandle) -> Self
Attach a tier-scoped moq_net::StatsHandle to this session.
Sourcepub async fn ok(self) -> Result<Session>
pub async fn ok(self) -> Result<Session>
Accept the session, performing rest of the MoQ handshake.
Sourcepub fn transport(&self) -> &'static str
pub fn transport(&self) -> &'static str
Returns the transport type as a string (e.g. “quic”, “iroh”).
Sourcepub fn peer_identity(&self) -> Option<PeerIdentity>
pub fn peer_identity(&self) -> Option<PeerIdentity>
The client certificate chain the peer presented, if any, validated
against a configured crate::tls::Server::root during the handshake.
Only the Quinn and noq backends support mTLS; other backends always
return None. Use it to grant elevated access or to close the session
once the certificate expires (see crate::tls::PeerIdentity::expiry).
Sourcepub fn has_peer_certificate(&self) -> bool
👎Deprecated: use peer_identity instead
pub fn has_peer_certificate(&self) -> bool
use peer_identity instead
Whether the peer presented a valid client certificate during the handshake.