pub struct Packets {}
Expand description
Structure for storing functions related to creation of packets
Implementations
sourceimpl Packets
impl Packets
sourcepub fn response<C: PacketContent>(
packet: &OpaquePacket,
contents: C
) -> Packet<C>
pub fn response<C: PacketContent>(
packet: &OpaquePacket,
contents: C
) -> Packet<C>
Creates a new response packet for responding to the provided
decodable packet. With the contents
sourcepub fn response_empty(packet: &OpaquePacket) -> Packet<EmptyContent>
pub fn response_empty(packet: &OpaquePacket) -> Packet<EmptyContent>
Shortcut function for creating a response packet with no content
sourcepub fn error<C: PacketContent>(
packet: &OpaquePacket,
error: impl Into<u16>,
contents: C
) -> Packet<C>
pub fn error<C: PacketContent>(
packet: &OpaquePacket,
error: impl Into<u16>,
contents: C
) -> Packet<C>
Creates a new error response packet for responding to the
provided packet with an error number with contents
sourcepub fn error_empty(
packet: &OpaquePacket,
error: impl Into<u16>
) -> Packet<EmptyContent>
pub fn error_empty(
packet: &OpaquePacket,
error: impl Into<u16>
) -> Packet<EmptyContent>
Shortcut function for creating an error packet with no content
sourcepub fn notify<C: PacketContent>(
component: impl PacketComponent,
contents: C
) -> Packet<C>
pub fn notify<C: PacketContent>(
component: impl PacketComponent,
contents: C
) -> Packet<C>
Creates a new notify packet with the provided component and command
and contents
sourcepub fn notify_empty(component: impl PacketComponent) -> Packet<EmptyContent>
pub fn notify_empty(component: impl PacketComponent) -> Packet<EmptyContent>
Shortcut function for creating a notify packet with no content
sourcepub fn request<R: RequestCounter, C: PacketContent>(
counter: &mut R,
component: impl PacketComponent,
contents: C
) -> Packet<C>
pub fn request<R: RequestCounter, C: PacketContent>(
counter: &mut R,
component: impl PacketComponent,
contents: C
) -> Packet<C>
Creates a new request packet retrieving its ID from the provided request counter.
Auto Trait Implementations
impl RefUnwindSafe for Packets
impl Send for Packets
impl Sync for Packets
impl Unpin for Packets
impl UnwindSafe for Packets
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more