MQTT 3.1.1 packet codec helpers for MoonBit without transport or client runtime
pub(all) struct Connect {
client_id : String
username : String?
password : Bytes?
will_topic : String?
will_message : Bytes?
keep_alive : Int
flags : ConnectFlags
} derive(Debug)pub(all) struct FixedHeader {
message_type : MessageType
dup : Bool
qos : QoS
retain : Bool
remaining_length : Int
header_len : Int
} derive(Debug)pub(all) enum Packet {
ConnectPacket(Connect)
ConnackPacket(Connack)
PublishPacket(Publish)
PubackPacket(PacketId)
PubrecPacket(PacketId)
PubrelPacket(PacketId)
PubcompPacket(PacketId)
SubscribePacket(Subscribe)
SubackPacket(Suback)
UnsubscribePacket(Unsubscribe)
UnsubackPacket(Unsuback)
PingreqPacket
PingrespPacket
DisconnectPacket
} derive(Debug)MQTT 3.1.1 packet codec helpers for MoonBit without transport or client runtime