Files
swift-nio-imap/Sources/NIOIMAPCore/Grammar/Response/ResponseCodeAppend.swift
T
David Evans 2fef4ba772 Implement RFC 4315 UIDPLUS (#302)
* Implement

* Test

* Fix tests
2020-09-03 10:51:04 +01:00

34 lines
954 B
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
//
//===----------------------------------------------------------------------===//
/// IMAPv4 `response-code-apnd`
public struct ResponseCodeAppend: Equatable {
public var num: Int
public var uid: UID
public init(num: Int, uid: UID) {
self.num = num
self.uid = uid
}
}
// MARK: - Encoding
extension EncodeBuffer {
@discardableResult mutating func writeResponseCodeAppend(_ data: ResponseCodeAppend) -> Int {
self.writeString("APPENDUID \(data.num) ") +
self.writeUID(data.uid)
}
}