mirror of
https://github.com/apple/swift-nio-imap
synced 2026-11-26 04:57:51 +00:00
`writeAuthIMAPURLRump`, `writeAuthIMAPURLFull`, `writeRelativeIMAPURL`, `writeURLFetchType`, `writeInternetMessageDate` and `writeListSelectBaseOptionQuoted` had no callers outside their own encode tests, nor did the writers only they reached (`writeAuthenticatedURL(NetworkMessagePath)`, `writeNetworkPath`, `writeAbsoluteMessagePath`, `writeIUIDOnly`, `writeURLMessageSectionOnly`, `writeMessagePathByteRangeOnly`). Delete them and those tests; parse tests stay.
60 lines
2.1 KiB
Swift
60 lines
2.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
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
/// An absolute IMAP URL path that does not include server information.
|
|
///
|
|
/// An absolute message path is a relative URL (RFC 3986) that specifies a command to execute
|
|
/// without providing server connection details. This is used in contexts where the server is
|
|
/// already known or provided separately, such as when resolving relative URLs.
|
|
///
|
|
/// The absolute path starts with `/` and optionally includes a command specification.
|
|
/// Unlike ``NetworkMessagePath``, it does not include the server hostname or port.
|
|
///
|
|
/// ### Examples
|
|
///
|
|
/// Absolute path without a command (refers to the document root):
|
|
/// ```
|
|
/// /
|
|
/// ```
|
|
///
|
|
/// Absolute path with a fetch command:
|
|
/// ```
|
|
/// /INBOX/;uid=20
|
|
/// ```
|
|
///
|
|
/// In relative URL resolution, an absolute path is resolved relative to the server:
|
|
/// ```
|
|
/// Base: imap://user@example.com/
|
|
/// Absolute path: /INBOX/;uid=20
|
|
/// Result: imap://user@example.com/INBOX/;uid=20
|
|
/// ```
|
|
///
|
|
/// ## Related types
|
|
///
|
|
/// - ``RelativeIMAPURL`` uses absolute message paths as one variant of relative URLs
|
|
/// - ``URLCommand`` specifies the fetch operation details
|
|
/// - ``NetworkPath`` provides network-accessible paths (with server information)
|
|
///
|
|
/// - SeeAlso: [RFC 3986 Section 3.3](https://datatracker.ietf.org/doc/html/rfc3986#section-3.3) - Absolute Path
|
|
public struct AbsoluteMessagePath: Hashable, Sendable {
|
|
/// Optional command to execute on the specified path.
|
|
public var command: URLCommand?
|
|
|
|
/// Creates a new absolute message path.
|
|
/// - parameter command: Optional command to execute. Defaults to `nil`.
|
|
public init(command: URLCommand?) {
|
|
self.command = command
|
|
}
|
|
}
|