Struct SessionRequest
pub struct SessionRequest { /* private fields */ }Expand description
What a peer asked for when it opened a session. What a peer asked for when it opened a session.
Its Debug output names the query keys and whether a token is present,
but never a query value or the token, so a request is safe to log.
Implementations§
§impl SessionRequest
impl SessionRequest
pub fn new(target: &str) -> SessionRequest
pub fn new(target: &str) -> SessionRequest
Parses a request target, /<path>?<query>.
pub fn from_handshake(handshake: &Handshake) -> SessionRequest
pub fn from_handshake(handshake: &Handshake) -> SessionRequest
Returns what a client asked for in its MoQ SETUP: a path, and maybe a token.
pub fn from_setup(target: &str, token: Option<(u64, &[u8])>) -> SessionRequest
pub fn from_setup(target: &str, token: Option<(u64, &[u8])>) -> SessionRequest
Returns the request of a SETUP with target and a token of the given type and bytes.
Only an out-of-band token, type moq_net::setup::Token::OUT_OF_BAND,
that is valid UTF-8 counts.
pub fn with_token(self, token: impl Into<String>) -> SessionRequest
pub fn with_token(self, token: impl Into<String>) -> SessionRequest
Sets the token the peer presented outside the target, such as in its MoQ SETUP.
pub fn query(&self, key: &str) -> Option<&str>
pub fn query(&self, key: &str) -> Option<&str>
Returns a query parameter of the request, such as jwt.
pub fn token(&self) -> Option<&str>
pub fn token(&self) -> Option<&str>
Returns the token the peer presented.
That is the token set with with_token, or else the
jwt query parameter, or else the token one. Writers use jwt, which
moq-relay reads.
Trait Implementations§
§impl Clone for SessionRequest
impl Clone for SessionRequest
§fn clone(&self) -> SessionRequest
fn clone(&self) -> SessionRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more