pub struct Channel { /* private fields */ }Expand description
Represents a communication channel with independent ordering/sequencing. Each peer can have multiple channels for different types of traffic.
Implementations§
Source§impl Channel
impl Channel
Sourcepub fn new(
id: u8,
delivery: DeliveryGuarantee,
ordering: OrderingGuarantee,
) -> Self
pub fn new( id: u8, delivery: DeliveryGuarantee, ordering: OrderingGuarantee, ) -> Self
Creates a new channel with specified guarantees.
Sourcepub fn unreliable(id: u8) -> Self
pub fn unreliable(id: u8) -> Self
Creates an unreliable, unordered channel (like UDP).
Sourcepub fn unreliable_sequenced(id: u8) -> Self
pub fn unreliable_sequenced(id: u8) -> Self
Creates an unreliable, sequenced channel (drops old packets).
Sourcepub fn reliable_unordered(id: u8) -> Self
pub fn reliable_unordered(id: u8) -> Self
Creates a reliable, unordered channel.
Sourcepub fn reliable_ordered(id: u8) -> Self
pub fn reliable_ordered(id: u8) -> Self
Creates a reliable, ordered channel (like TCP).
Sourcepub fn delivery(&self) -> DeliveryGuarantee
pub fn delivery(&self) -> DeliveryGuarantee
Returns the delivery guarantee.
Sourcepub fn ordering(&self) -> OrderingGuarantee
pub fn ordering(&self) -> OrderingGuarantee
Returns the ordering guarantee.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Channel
impl RefUnwindSafe for Channel
impl Send for Channel
impl Sync for Channel
impl Unpin for Channel
impl UnwindSafe for Channel
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