pub struct SendQueue { /* private fields */ }
Expand description
This queue is used to prioritize packets being sent out
Packets that are old, are either dropped or requested again.
You can define this behavior with the timeout
property.
Implementations§
Source§impl SendQueue
impl SendQueue
pub fn new( mtu_size: u16, _timeout: u16, _max_tries: u16, socket: Arc<UdpSocket>, address: SocketAddr, ) -> Self
Sourcepub async fn insert(
&mut self,
packet: &[u8],
reliability: Reliability,
immediate: bool,
channel: Option<u8>,
) -> Result<(), SendQueueError>
pub async fn insert( &mut self, packet: &[u8], reliability: Reliability, immediate: bool, channel: Option<u8>, ) -> Result<(), SendQueueError>
Send a packet based on its reliability.
Note, reliability will be set to Reliability::ReliableOrd
if
the buffer is larger than max MTU.
pub async fn send_packet( &mut self, packet: RakPacket, reliability: Reliability, immediate: bool, ) -> Result<(), SendQueueError>
pub async fn update(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SendQueue
impl RefUnwindSafe for SendQueue
impl Send for SendQueue
impl Sync for SendQueue
impl Unpin for SendQueue
impl UnwindSafe for SendQueue
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