Struct webrtc_srtp::session::Session
source · pub struct Session { /* private fields */ }
Expand description
Session implements io.ReadWriteCloser and provides a bi-directional SRTP session SRTP itself does not have a design like this, but it is common in most applications for local/remote to each have their own keying material. This provides those patterns instead of making everyone re-implement
Implementations§
source§impl Session
impl Session
pub async fn new( conn: Arc<dyn Conn + Send + Sync>, config: Config, is_rtp: bool ) -> Result<Self, Error>
sourcepub async fn open(&self, ssrc: u32) -> Arc<Stream>
pub async fn open(&self, ssrc: u32) -> Arc<Stream>
open on the given SSRC to create a stream, it can be used if you want a certain SSRC, but don’t want to wait for Accept
sourcepub async fn accept(&self) -> Result<Arc<Stream>, Error>
pub async fn accept(&self) -> Result<Arc<Stream>, Error>
accept returns a stream to handle RTCP for a single SSRC
pub async fn close(&self) -> Result<(), Error>
pub async fn write(&self, buf: &Bytes, is_rtp: bool) -> Result<usize, Error>
pub async fn write_rtp(&self, pkt: &Packet) -> Result<usize, Error>
pub async fn write_rtcp( &self, pkt: &(dyn Packet + Send + Sync) ) -> Result<usize, Error>
Auto Trait Implementations§
impl Freeze for Session
impl !RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl !UnwindSafe 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