pub struct Packet<'a> {
    pub stream_id: u32,
    pub packet_type: PacketType<'a>,
}Expand description
Wisp protocol packet.
Fields§
§stream_id: u32Stream 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