pub struct Packet {
pub stream_id: u32,
pub packet_type: PacketType,
}
Expand description
Wisp protocol packet.
Fields§
§stream_id: u32
Stream this packet is associated with.
packet_type: PacketType
Packet type recieved.
Implementations§
source§impl Packet
impl Packet
sourcepub fn new(stream_id: u32, packet: PacketType) -> Self
pub fn new(stream_id: u32, packet: PacketType) -> Self
Create a new packet.
The helper functions should be used for most use cases.
sourcepub fn new_connect(
stream_id: u32,
stream_type: StreamType,
destination_port: u16,
destination_hostname: String
) -> Self
pub fn new_connect( stream_id: u32, stream_type: StreamType, destination_port: u16, destination_hostname: String ) -> Self
Create a new connect packet.
sourcepub fn new_continue(stream_id: u32, buffer_remaining: u32) -> Self
pub fn new_continue(stream_id: u32, buffer_remaining: u32) -> Self
Create a new continue packet.
sourcepub fn new_close(stream_id: u32, reason: CloseReason) -> Self
pub fn new_close(stream_id: u32, reason: CloseReason) -> Self
Create a new close packet.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Packet
impl !RefUnwindSafe for Packet
impl Send for Packet
impl Sync for Packet
impl Unpin for Packet
impl !UnwindSafe for Packet
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