pub struct Packet<'a> {
pub stream_id: u32,
pub packet_type: PacketType<'a>,
}
Expand description
Wisp protocol packet.
Fields§
§stream_id: u32
Stream this packet is associated with.
packet_type: PacketType<'a>
Packet type recieved.
Implementations§
source§impl<'a> Packet<'a>
impl<'a> Packet<'a>
sourcepub fn new(stream_id: u32, packet: PacketType<'a>) -> Self
pub fn new(stream_id: u32, packet: PacketType<'a>) -> 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<'a> Freeze for Packet<'a>
impl<'a> !RefUnwindSafe for Packet<'a>
impl<'a> Send for Packet<'a>
impl<'a> Sync for Packet<'a>
impl<'a> Unpin for Packet<'a>
impl<'a> !UnwindSafe for Packet<'a>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)