Struct packet_stream_codec::Metadata
[−]
[src]
pub struct Metadata {
pub flags: u8,
pub id: PacketId,
}The metadata of a packet.
Fields
flags: u8
Flags indicate the type of the data in the packet, whether the packet is a request, and wether it signals an end/error.
id: PacketId
The id of the packet.
Methods
impl Metadata[src]
pub fn is_stream_packet(&self) -> bool[src]
Returns true if the stream flag of the packet is set.
pub fn is_end_packet(&self) -> bool[src]
Returns true if the end/error flag of the packet is set.
pub fn is_buffer_packet(&self) -> bool[src]
Returns true if the type flags signal a buffer.
pub fn is_string_packet(&self) -> bool[src]
Returns true if the type flags signal a string.
pub fn is_json_packet(&self) -> bool[src]
Returns true if the type flags signal json.
pub fn is_unused_packet(&self) -> bool[src]
Returns true if the type flags signal the unused type.
A CodecStream returns an error if it encounters a paket with this type,
so this returns false for all Metadatas yielded from a CodecStream.
Trait Implementations
impl Debug for Metadata[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more