Struct coap::message::packet::Packet
[−]
[src]
pub struct Packet { pub header: Header, pub payload: Vec<u8>, // some fields omitted }
Fields
header: Header
payload: Vec<u8>
Methods
impl Packet
[src]
fn new() -> Packet
[src]
fn set_token(&mut self, token: Vec<u8>)
[src]
fn get_token(&self) -> &Vec<u8>
[src]
fn set_option(&mut self, tp: CoAPOption, value: LinkedList<Vec<u8>>)
[src]
fn set_content_format(&mut self, cf: ContentFormat)
[src]
fn set_payload(&mut self, payload: Vec<u8>)
[src]
fn add_option(&mut self, tp: CoAPOption, value: Vec<u8>)
[src]
fn get_option(&self, tp: CoAPOption) -> Option<LinkedList<Vec<u8>>>
[src]
fn get_content_format(&self) -> Option<ContentFormat>
[src]
fn from_bytes(buf: &[u8]) -> Result<Packet, ParseError>
[src]
Decodes a byte slice and construct the equivalent Packet.
fn to_bytes(&self) -> Result<Vec<u8>, PackageError>
[src]
Returns a vector of bytes representing the Packet.