File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,12 @@ extension RFC_1123.Domain.Label: Hashable {
7474// MARK: - Serializable
7575
7676extension RFC_1123 . Domain . Label : UInt8 . ASCII . Serializable {
77- // public static let serialize: @Sendable (Self) -> [UInt8] = [UInt8].init
77+ public static func serialize< Buffer: RangeReplaceableCollection > (
78+ ascii label: Self ,
79+ into buffer: inout Buffer
80+ ) where Buffer. Element == UInt8 {
81+ buffer. append ( contentsOf: label. rawValue. utf8)
82+ }
7883
7984 /// Parses a host label from canonical byte representation (CANONICAL PRIMITIVE)
8085 ///
Original file line number Diff line number Diff line change 66//
77
88public import INCITS_4_1986
9- public import RFC_1035
9+ import RFC_1035
1010
1111extension RFC_1123 {
1212 /// RFC 1123 compliant host name
@@ -94,6 +94,13 @@ extension RFC_1123.Domain: UInt8.ASCII.RawRepresentable {}
9494extension RFC_1123 . Domain : CustomStringConvertible { }
9595
9696extension RFC_1123 . Domain : UInt8 . ASCII . Serializable {
97+ public static func serialize< Buffer: RangeReplaceableCollection > (
98+ ascii domain: Self ,
99+ into buffer: inout Buffer
100+ ) where Buffer. Element == UInt8 {
101+ buffer. append ( contentsOf: domain. rawValue. utf8)
102+ }
103+
97104 /// Parses a host name from canonical byte representation (CANONICAL PRIMITIVE)
98105 ///
99106 /// This is the primitive parser that works at the byte level.
You can’t perform that action at this time.
0 commit comments