@@ -2,10 +2,8 @@ import Core
2
2
3
3
private let crlf : Bytes = [ . carriageReturn, . newLine]
4
4
5
- /**
6
- Creates a multipart formatted array of bytes from Parts
7
- suitable for an HTTP response or request body.
8
- */
5
+ /// Creates a multipart formatted array of bytes from Parts
6
+ /// suitable for an HTTP response or request body.
9
7
public final class Serializer {
10
8
/// The multipart boundary being used.
11
9
public let boundary : Bytes
@@ -28,15 +26,13 @@ public final class Serializer {
28
26
case epilogueAlreadySerialized
29
27
}
30
28
31
- /**
32
- Call this method to add bytes to the preamble.
33
-
34
- This is equivalent to simply prepending bytes
35
- to the beginning of the serialized data.
36
-
37
- Preamble can obviously not be serialized after
38
- parts or the epilogue have been serialized.
39
- */
29
+ /// Call this method to add bytes to the preamble.
30
+ ///
31
+ /// This is equivalent to simply prepending bytes
32
+ /// to the beginning of the serialized data.
33
+ ///
34
+ /// Preamble can obviously not be serialized after
35
+ /// parts or the epilogue have been serialized.
40
36
public func serialize( preamble: Bytes ) throws {
41
37
guard !partsSerialized else {
42
38
throw Error . partsAlreadySerialized
@@ -45,17 +41,15 @@ public final class Serializer {
45
41
serialize ( preamble)
46
42
}
47
43
48
- /**
49
- This method serializes an entire Part.
50
-
51
- This may be called as many times as needed.
52
-
53
- After all Parts have been serialized,
54
- `finish()` must be called to add the closing boundary.
55
-
56
- Parts can obviously not be serialized after the
57
- epilogue has been serialized.
58
- */
44
+ /// This method serializes an entire Part.
45
+ ///
46
+ /// This may be called as many times as needed.
47
+ ///
48
+ /// After all Parts have been serialized,
49
+ /// `finish()` must be called to add the closing boundary.
50
+ ///
51
+ /// Parts can obviously not be serialized after the
52
+ /// epilogue has been serialized.
59
53
public func serialize( _ part: Part ) throws {
60
54
guard !epilogueSerialized else {
61
55
throw Error . epilogueAlreadySerialized
@@ -79,14 +73,12 @@ public final class Serializer {
79
73
partsSerialized = true
80
74
}
81
75
82
- /**
83
- This method serializes the closing boundary.
84
-
85
- No parts or preamble can be serialized after this
86
- method is called.
87
-
88
- This method must be called to complete the serialized data.
89
- */
76
+ /// This method serializes the closing boundary.
77
+ ///
78
+ /// No parts or preamble can be serialized after this
79
+ /// method is called.
80
+ ///
81
+ /// This method must be called to complete the serialized data.
90
82
public func finish( epilogue: Bytes = [ ] ) throws {
91
83
guard !epilogueSerialized else {
92
84
throw Error . epilogueAlreadySerialized
0 commit comments