Files
HaishinKit.swift/RTMPHaishinKit/Sources/RTMP/RTMPResponse.swift
2025-07-13 12:43:53 +09:00

20 lines
591 B
Swift

import Foundation
/// The metadata associated with the response to an RTMP protocol request.
public struct RTMPResponse: Sendable {
/// The RTMP response status.
public let status: RTMPStatus?
/// The RTMP response arguments.
public let arguments: [(any Sendable)?]
init(status: RTMPStatus?, arguments: [(any Sendable)?] = []) {
self.status = status
self.arguments = arguments
}
init(_ message: RTMPCommandMessage) {
arguments = message.arguments
status = arguments.isEmpty ? nil : .init(arguments.first as? AMFObject)
}
}