pub struct PeerDatagramPolicy { /* private fields */ }Implementations§
Source§impl PeerDatagramPolicy
impl PeerDatagramPolicy
pub fn new(max_datagram_size: usize) -> Self
pub fn set_incoming_max_age_ms(&mut self, value: Option<u64>, now_ms: u64)
pub fn set_outgoing_max_age_ms(&mut self, value: Option<u64>)
pub fn set_incoming_max_buffered(&mut self, value: usize) -> Result<()>
pub fn set_outgoing_max_buffered(&mut self, value: usize) -> Result<()>
pub fn push_incoming(&mut self, payload: Vec<u8>, now_ms: u64) -> Result<()>
pub fn pop_incoming(&mut self, now_ms: u64) -> Option<Vec<u8>>
Sourcepub fn push_outgoing(&mut self, payload: Vec<u8>, now_ms: u64) -> Result<bool>
pub fn push_outgoing(&mut self, payload: Vec<u8>, now_ms: u64) -> Result<bool>
Returns false when the bounded queue is full so the Web Streams or
native adapter can apply backpressure without owning the drop policy.
pub fn pop_outgoing(&mut self, now_ms: u64) -> Option<OutgoingPeerDatagram>
pub fn record_sent(&mut self, bytes: usize)
pub fn record_expired_outgoing(&mut self)
pub fn record_send_failure(&mut self)
pub fn stats(&mut self, now_ms: u64) -> PeerDatagramStats
pub fn close_incoming(&mut self)
pub fn close_outgoing(&mut self)
pub fn close(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PeerDatagramPolicy
impl RefUnwindSafe for PeerDatagramPolicy
impl Send for PeerDatagramPolicy
impl Sync for PeerDatagramPolicy
impl Unpin for PeerDatagramPolicy
impl UnsafeUnpin for PeerDatagramPolicy
impl UnwindSafe for PeerDatagramPolicy
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