Trait valence_protocol::encode::WritePacket
source · pub trait WritePacket {
// Required methods
fn write_packet_fallible<P>(&mut self, packet: &P) -> Result<()>
where P: Packet + Encode;
fn write_packet_bytes(&mut self, bytes: &[u8]);
// Provided method
fn write_packet<P>(&mut self, packet: &P)
where P: Packet + Encode { ... }
}
Expand description
Types that can have packets written to them.
Required Methods§
sourcefn write_packet_fallible<P>(&mut self, packet: &P) -> Result<()>
fn write_packet_fallible<P>(&mut self, packet: &P) -> Result<()>
Writes a packet to this object. The result of encoding the packet is returned.
sourcefn write_packet_bytes(&mut self, bytes: &[u8])
fn write_packet_bytes(&mut self, bytes: &[u8])
Copies raw packet data directly into this object. Don’t use this unless you know what you’re doing.
Provided Methods§
sourcefn write_packet<P>(&mut self, packet: &P)
fn write_packet<P>(&mut self, packet: &P)
Writes a packet to this object. Encoding errors are typically logged and discarded.
Object Safety§
This trait is not object safe.