pub struct Session { /* private fields */ }Expand description
Drives a Rtc instance until it ends.
The caller pre-populates the Rtc with whatever SDP exchange they need.
Sends go out the (possibly shared) socket; inbound datagrams arrive on
inbound rather than being read off the socket directly, so several
sessions can share one socket behind the crate::server::mux.
Implementations§
Source§impl Session
impl Session
Sourcepub fn ingest(
rtc: Rtc,
socket: Arc<UdpSocket>,
locals: Vec<SocketAddr>,
inbound: Receiver<(Vec<u8>, SocketAddr)>,
sink: Box<dyn MediaSink>,
) -> Self
pub fn ingest( rtc: Rtc, socket: Arc<UdpSocket>, locals: Vec<SocketAddr>, inbound: Receiver<(Vec<u8>, SocketAddr)>, sink: Box<dyn MediaSink>, ) -> Self
Convenience for the ingest case (WHIP server, WHEP client). locals are the
advertised ICE candidates (see the field docs), not the socket bind.
Sourcepub fn egress(
rtc: Rtc,
socket: Arc<UdpSocket>,
locals: Vec<SocketAddr>,
inbound: Receiver<(Vec<u8>, SocketAddr)>,
source: EgressSource,
) -> Self
pub fn egress( rtc: Rtc, socket: Arc<UdpSocket>, locals: Vec<SocketAddr>, inbound: Receiver<(Vec<u8>, SocketAddr)>, source: EgressSource, ) -> Self
Convenience for the egress case (WHEP server, WHIP client). locals are the
advertised ICE candidates (see the field docs), not the socket bind.
pub async fn run(self) -> Result<()>
Auto Trait Implementations§
impl !Freeze for Session
impl !RefUnwindSafe for Session
impl !Sync for Session
impl !UnwindSafe for Session
impl Send for Session
impl Unpin for Session
impl UnsafeUnpin for Session
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