spoke/packet/client/outgoing

Outgoing packets for a MQTT client

Types

Represents all the valid outgoing packets for an MQTT client.

pub type Packet {
  Connect(packet.ConnectOptions)
  Publish(packet.PublishData)
  PubAck(packet_id: Int)
  PubRec(packet_id: Int)
  PubRel(packet_id: Int)
  PubComp(packet_id: Int)
  Subscribe(
    packet_id: Int,
    topic: packet.SubscribeRequest,
    other_topics: List(packet.SubscribeRequest),
  )
  Unsubscribe(
    packet_id: Int,
    topic: String,
    other_topics: List(String),
  )
  PingReq
  Disconnect
}

Constructors

Values

pub fn encode_packet(packet: Packet) -> bytes_tree.BytesTree

Encodes a packet into its binary form.

Search Document