mirror of
https://github.com/apple/swift-nio-imap
synced 2026-11-28 05:14:27 +00:00
Small fields (mailbox names, atoms, quoted strings, envelope fields, base64, URLs, the authentication challenge, catenateURL, ...) become [UInt8]. The four raw-payload cases stay ByteBuffer until "Make payload cases IMAPBuffer". The grammar's string productions return [UInt8]. The parser still runs on ParseBuffer, so its cursor methods copy out of the ByteBuffer for now. Review focus: the model files' encoders and ModifiedUTF7 on arrays. Updates IMAPTool and the IMAPCommands catenate-URL wrapper. Public API breaks: - ~38 public declarations ByteBuffer -> [UInt8]. - ModifiedUTF7.EncodingRoundtripError.buffer -> .bytes. - Response.authenticationChallenge and ContinuationRequest.data are [UInt8]; an empty challenge is []. Internal: writeBufferAsBase64 -> writeBytesAsBase64; the ByteBuffer writeIMAPString overload is gone.
25 lines
835 B
Swift
25 lines
835 B
Swift
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This source file is part of the SwiftNIO open source project
|
|
//
|
|
// Copyright (c) 2026 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
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
import struct NIO.ByteBuffer
|
|
|
|
// Temporary: lets the payload cases that still hold a `ByteBuffer` write through the sink. Removed in
|
|
// "Make payload cases IMAPBuffer".
|
|
extension EncodeBuffer {
|
|
@discardableResult
|
|
mutating func writeBuffer(_ buffer: inout ByteBuffer) -> Int {
|
|
self.writeBytes(buffer.readableBytesView)
|
|
}
|
|
}
|