debugDescription
WebSocketFrame.swift:414var debugDescription: String { get }
var debugDescription: String { get }
import NIOWebSocket
struct WebSocketFrame
A structured representation of a single WebSocket frame.
@frozen struct String
A Unicode string value that is a collection of characters.
init(allocator: ByteBufferAllocator)
Creates an empty WebSocketFrame
.
init(fin: Bool = false, rsv1: Bool = false, rsv2: Bool = false, rsv3: Bool = false, opcode: WebSocketOpcode = .continuation, maskKey: WebSocketMaskingKey? = nil, data: ByteBuffer, extensionData: ByteBuffer? = nil)
Create a WebSocketFrame
with the given properties.
var data: ByteBuffer { get set }
The application data.
var description: String { get }
A String
describing this WebSocketFrame
. Example:
var extensionData: ByteBuffer? { get set }
The extension data, if any.
var fin: Bool { get set }
The value of the fin
bit. If set, this is the last frame in a fragmented frame. If not set, this frame is one of the intermediate frames in a fragmented frame. Must be set if a frame is not fragmented at all.
var length: Int { get }
The total length of the data in the frame.
var maskKey: WebSocketMaskingKey?
The masking key, if any.
var opcode: WebSocketOpcode { get set }
The opcode for this frame.
var reservedBits: ReservedBits { get set }
The value of all the reserved bits. Must be empty
unless using an extension that defines their use.
var rsv1: Bool { get set }
The value of the first reserved bit. Must be false
unless using an extension that defines its use.
var rsv2: Bool { get set }
The value of the second reserved bit. Must be false
unless using an extension that defines its use.
var rsv3: Bool { get set }
The value of the third reserved bit. Must be false
unless using an extension that defines its use.
var unmaskedData: ByteBuffer { get }
The unmasked application data.
var unmaskedExtensionData: ByteBuffer? { get }
The unmasked extension data.
struct ReservedBits
WebSocketFrame reserved bits option set