When the response text of a continuation response began with base64 characters, the response would be interpreted as base64. Any remaining characters would cause a parser error.
Rework the parser to only interpret the text as base64 if all of the text is base64 characters.
Each “part” in a `BodyStructure` has an RFC 2045 “media type” — which is a combination of “top level type” + “sub-stype”.
But the types that were previously used, were inconsistently used / named. This PR cleans up the use of these and makes them consistent.
Additionally it adds a
```swift
extension BodyStructure {
public var mediaType: Media.MediaType
}
```
such that it’s easy to get to a part’s media type, regardless of its kind.
With this PR the implementation of `CustomDebugStringConvertible` generally uses new `makeDescription` convenience methods on the three encode buffers, e.g.:
```swift
extension ResponseEncodeBuffer {
static func makeDescription(_ closure: (inout ResponseEncodeBuffer) -> Void) -> String
}
```
such that conformance can be implemented as e.g.
```swift
extension Command: CustomDebugStringConvertible {
public var debugDescription: String {
CommandEncodeBuffer.makeDescription {
$0.writeCommand(self)
}
}
}
```
This also adds `CustomDebugStringConvertible` to `MessageAttribute` and `StreamingKind`.
Modification sequence numbers need to be in the range 0-Int64.max (63 bit unsiged values). When parsing, use the failing initializer, instead of the one with a `precondition()`.
The `FramingParser` might split a `CRLF` lineline into `CF` only (`LF` in the “next frame”). The `CommandParser` thus needs to be able to parse
```text
A26 UID FETCH 1:10002 (UID FLAGS MODSEQ)\r
```
as a valid and complete command.
Since it’s common to use `MailboxName` as a key in a dictionary and/or compare `MailboxName` for equality, `MailboxName` will pre-calculate its hash value, and store it. As a result `Hashable` (and `Equatable`) performance is very fast.