pub struct SessionRequest { /* private fields */ }Expand description
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§
Source§impl SessionRequest
impl SessionRequest
Sourcepub fn from_handshake(handshake: &Handshake) -> Self
pub fn from_handshake(handshake: &Handshake) -> Self
Returns what a client asked for in its MoQ SETUP: a path, and maybe a token.
Sourcepub fn from_setup(target: &str, token: Option<(u64, &[u8])>) -> Self
pub fn from_setup(target: &str, token: Option<(u64, &[u8])>) -> Self
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.
Sourcepub fn with_token(self, token: impl Into<String>) -> Self
pub fn with_token(self, token: impl Into<String>) -> Self
Sets the token the peer presented outside the target, such as in its MoQ SETUP.
Sourcepub 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.
Sourcepub 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§
Source§impl Clone for SessionRequest
impl Clone for SessionRequest
Source§impl Debug for SessionRequest
impl Debug for SessionRequest
Auto Trait Implementations§
impl Freeze for SessionRequest
impl RefUnwindSafe for SessionRequest
impl Send for SessionRequest
impl Sync for SessionRequest
impl Unpin for SessionRequest
impl UnsafeUnpin for SessionRequest
impl UnwindSafe for SessionRequest
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
Mutably borrows from an owned value. Read more