mirror of
https://github.com/apple/swift-nio
synced 2026-11-24 04:37:54 +00:00
Add support for treating WebSocketFrame reserved bits as an option set ### Motivation: I would like to do mask operations on the reserved bits of the WebSocketFrame eg check none are set, check only bits in a mask are set. With the current public interface it is only possible to check the state of one bit at a time. ### Modifications: Add `WebSocketFrame.ReservedBits` OptionSet Add computed member `WebSocketFrame.reservedBits` ### Result: I can now check the status of multiple bits in one operation eg `frame.reservedBits.isEmpty` `frame.reservedBits.itersection([.rsv1, .rsv2]).isEmpty`