pub struct Request<S: Session> { /* private fields */ }Expand description
A paused server-side handshake.
Returned by Server::accept_request once the peer’s advertised
path is known but before the session is granted anything. Set
the origins to serve, then call ok to complete the handshake, or
close to reject it. Modeled on the WebTransport Request in
moq-native.
Implementations§
Source§impl<S: Session> Request<S>
impl<S: Session> Request<S>
Sourcepub fn path(&self) -> &str
pub fn path(&self) -> &str
The request path the client advertised in its SETUP.
Empty when the client advertised none: either it sent an empty path, or the
version carries none in-band (lite 01-04). Those mean the same thing, so the
wire distinction isn’t surfaced. Populated for moq-lite-05 and every
moq-transport draft we speak. See the note on Server::accept_request.
Sourcepub fn role(&self) -> Option<Role>
pub fn role(&self) -> Option<Role>
The single Role the client advertised in its SETUP, or None for a
bidirectional session.
Only moq-lite-05 carries a role, so None covers three cases that the wire
doesn’t distinguish: an older version, a client that omitted the parameter, and a
client that explicitly advertised both directions. All three mean the same thing
(the client may publish and subscribe), so authorize on what the token grants.
See the note on Server::accept_request.
Sourcepub fn with_publisher(self, publish: impl Consume<Consumer>) -> Self
pub fn with_publisher(self, publish: impl Consume<Consumer>) -> Self
Sourcepub fn with_subscriber(self, subscribe: Producer) -> Self
pub fn with_subscriber(self, subscribe: Producer) -> Self
Subscribe to the connected client. Overrides any value from the Server builder.
Sourcepub fn with_stats(self, stats: Session) -> Self
pub fn with_stats(self, stats: Session) -> Self
Set the per-connection stats::Session context. Overrides any value from the
Server builder.