mirror of
https://github.com/apple/swift-nio-imap
synced 2026-11-24 04:38:04 +00:00
We need CommandEncodeBuffer to be Equatable, but might as well make it Hashable. This required adding a few Hashable conformances downstream, and changing promoting existing Equatable conformance to Hashable.
33 lines
1.1 KiB
Swift
33 lines
1.1 KiB
Swift
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This source file is part of the SwiftNIO open source project
|
|
//
|
|
// Copyright (c) 2020 Apple Inc. and the SwiftNIO project authors
|
|
// Licensed under Apache License v2.0
|
|
//
|
|
// See LICENSE.txt for license information
|
|
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
/// Configuration options for writing Responses to a buffer for transmission.
|
|
public struct ResponseEncodingOptions: Hashable {
|
|
/// Use RFC 3501 _quoted strings_ when possible (and the string is relatively short).
|
|
public var useQuotedString: Bool
|
|
|
|
/// Create RFC 3501 compliant encoding options, i.e. without any IMAP extensions.
|
|
public init() {
|
|
self.useQuotedString = true
|
|
}
|
|
}
|
|
|
|
extension ResponseEncodingOptions {
|
|
/// Creates a new `ResponseEncodingOptions`.
|
|
/// - parameter capabilities: An array of server capabilities.
|
|
public init(capabilities: [Capability]) {
|
|
self.init()
|
|
}
|
|
}
|