public typealias ChannelID = UInt16
case method(ChannelID, Method)
case header(ChannelID, Header)
case body(ChannelID, body: ByteBuffer)
case heartbeat(ChannelID)
}
To
public struct Frame: PayloadDecodable, PayloadEncodable {
var channelID: ChannelID
var payload: Payload
enum Payload {
case method(Method)
case header(Header)
case body(ByteBuffer)
case heartbeat
}
}
From
To