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]
fn is_stream_packet(&self) -> bool
[src]
Returns true if the stream flag of the packet is set.
fn is_end_packet(&self) -> bool
[src]
Returns true if the end/error flag of the packet is set.
fn is_buffer_packet(&self) -> bool
[src]
Returns true if the type flags signal a buffer.
fn is_string_packet(&self) -> bool
[src]
Returns true if the type flags signal a string.
fn is_json_packet(&self) -> bool
[src]
Returns true if the type flags signal json.
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 Metadata
s yielded from a CodecStream
.