Struct webrtc_util::buffer::Buffer
source · [−]pub struct Buffer { /* private fields */ }
Implementations
sourceimpl Buffer
impl Buffer
pub fn new(limit_count: usize, limit_size: usize) -> Self
sourcepub async fn write(&self, packet: &[u8]) -> Result<usize>
pub async fn write(&self, packet: &[u8]) -> Result<usize>
Write appends a copy of the packet data to the buffer. Returns ErrFull if the packet doesn’t fit. Note that the packet size is limited to 65536 bytes since v0.11.0 due to the internal data structure.
pub async fn read(
&self,
packet: &mut [u8],
duration: Option<Duration>
) -> Result<usize>
pub async fn close(&self)
pub async fn is_closed(&self) -> bool
pub async fn count(&self) -> usize
pub async fn set_limit_count(&self, limit: usize)
pub async fn size(&self) -> usize
pub async fn set_limit_size(&self, limit: usize)
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Buffer
impl Send for Buffer
impl Sync for Buffer
impl Unpin for Buffer
impl !UnwindSafe for Buffer
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more