pub struct Session<S: Session> { /* private fields */ }Expand description
A MoQ session, constructed with OriginProducer and OriginConsumer halves.
This simplifies the state machine and immediately rejects any subscriptions that don’t match the origin prefix. You probably want to use Session unless you’re writing a relay.
Implementations§
Source§impl<S: Session + Sync> Session<S>
impl<S: Session + Sync> Session<S>
Sourcepub async fn connect(
session: S,
publish: impl Into<Option<OriginConsumer>>,
subscribe: impl Into<Option<OriginProducer>>,
) -> Result<Self, Error>
pub async fn connect( session: S, publish: impl Into<Option<OriginConsumer>>, subscribe: impl Into<Option<OriginProducer>>, ) -> Result<Self, Error>
Perform the MoQ handshake as a client.
Sourcepub async fn accept<P: Into<Option<OriginConsumer>>, C: Into<Option<OriginProducer>>>(
session: S,
publish: P,
subscribe: C,
) -> Result<Self, Error>
pub async fn accept<P: Into<Option<OriginConsumer>>, C: Into<Option<OriginProducer>>>( session: S, publish: P, subscribe: C, ) -> Result<Self, Error>
Perform the MoQ handshake as a server
Auto Trait Implementations§
impl<S> Freeze for Session<S>where
S: Freeze,
impl<S> RefUnwindSafe for Session<S>where
S: RefUnwindSafe,
impl<S> Send for Session<S>
impl<S> Sync for Session<S>
impl<S> Unpin for Session<S>where
S: Unpin,
impl<S> UnwindSafe for Session<S>where
S: UnwindSafe,
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