mirror of
https://github.com/apple/swift-nio
synced 2026-11-24 04:37:54 +00:00
Documentation checking catches more issues in Swift 6.0.
Adopt the Swift 6.0 image and fix the errors.
More accurate docs.
(cherry picked from commit adfd61adc5)
Co-authored-by: Rick Newton-Rogers <rnro@apple.com>
This commit is contained in:
1 parent
4d5eb6bb15
commit
653da4d987
100 files changed
+2092
-2061
No files matched your search
@@ -121,7 +121,7 @@ public struct BufferedWriter<Handle: WritableFileHandleProtocol> {
|
||||
///
|
||||
/// To manually flush bytes use ``flush()``.
|
||||
///
|
||||
/// - Parameter bytes: The `AsyncSequence` of byte chunks to write to the buffer.
|
||||
/// - Parameter chunks: The `AsyncSequence` of byte chunks to write to the buffer.
|
||||
/// - Returns: The number of bytes written into the buffered writer.
|
||||
@discardableResult
|
||||
public mutating func write<Chunks: AsyncSequence>(
|
||||
@@ -157,7 +157,7 @@ public struct BufferedWriter<Handle: WritableFileHandleProtocol> {
|
||||
///
|
||||
/// To manually flush bytes use ``flush()``.
|
||||
///
|
||||
/// - Parameter bytes: The `AsyncSequence` of `ByteBuffer`s to write.
|
||||
/// - Parameter chunks: The `AsyncSequence` of `ByteBuffer`s to write.
|
||||
/// - Returns: The number of bytes written into the buffered writer.
|
||||
@discardableResult
|
||||
public mutating func write<Chunks: AsyncSequence>(
|
||||
|
||||
@@ -155,8 +155,8 @@ public protocol FileHandleProtocol {
|
||||
/// > The seconds component must also be positive: if it's not, zero will be used as the value instead.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - lastAccessTime: The new value of the file's last access time, as time elapsed since the Epoch.
|
||||
/// - lastDataModificationTime: The new value of the file's last data modification time, as time elapsed since the Epoch.
|
||||
/// - lastAccess: The new value of the file's last access time, as time elapsed since the Epoch.
|
||||
/// - lastDataModification: The new value of the file's last data modification time, as time elapsed since the Epoch.
|
||||
///
|
||||
/// - Throws: If there's an error updating the times. If this happens, the original values won't be modified.
|
||||
func setTimes(
|
||||
@@ -212,7 +212,6 @@ extension ReadableFileHandleProtocol {
|
||||
/// - Parameters:
|
||||
/// - range: A range of offsets in the file to read.
|
||||
/// - chunkLength: The length of chunks to read, defaults to 128 KiB.
|
||||
/// - as: Type of chunk to read.
|
||||
/// - SeeAlso: ``ReadableFileHandleProtocol/readChunks(in:chunkLength:)-2dz6``
|
||||
/// - Returns: An `AsyncSequence` of chunks read from the file.
|
||||
public func readChunks(
|
||||
@@ -227,7 +226,6 @@ extension ReadableFileHandleProtocol {
|
||||
/// - Parameters:
|
||||
/// - range: A range of offsets in the file to read.
|
||||
/// - chunkLength: The length of chunks to read, defaults to 128 KiB.
|
||||
/// - as: Type of chunk to read.
|
||||
/// - SeeAlso: ``ReadableFileHandleProtocol/readChunks(in:chunkLength:)-2dz6``
|
||||
/// - Returns: An `AsyncSequence` of chunks read from the file.
|
||||
public func readChunks(
|
||||
@@ -242,7 +240,6 @@ extension ReadableFileHandleProtocol {
|
||||
/// - Parameters:
|
||||
/// - range: A range of offsets in the file to read.
|
||||
/// - chunkLength: The length of chunks to read, defaults to 128 KiB.
|
||||
/// - as: Type of chunk to read.
|
||||
/// - SeeAlso: ``ReadableFileHandleProtocol/readChunks(in:chunkLength:)-2dz6``.
|
||||
/// - Returns: An `AsyncSequence` of chunks read from the file.
|
||||
public func readChunks(
|
||||
@@ -258,7 +255,6 @@ extension ReadableFileHandleProtocol {
|
||||
/// - Parameters:
|
||||
/// - range: A range of offsets in the file to read.
|
||||
/// - chunkLength: The length of chunks to read, defaults to 128 KiB.
|
||||
/// - as: Type of chunk to read.
|
||||
/// - SeeAlso: ``ReadableFileHandleProtocol/readChunks(in:chunkLength:)-2dz6``.
|
||||
/// - Returns: An `AsyncSequence` of chunks read from the file.
|
||||
public func readChunks(
|
||||
@@ -274,7 +270,6 @@ extension ReadableFileHandleProtocol {
|
||||
/// - Parameters:
|
||||
/// - range: A range of offsets in the file to read.
|
||||
/// - chunkLength: The length of chunks to read, defaults to 128 KiB.
|
||||
/// - as: Type of chunk to read.
|
||||
/// - SeeAlso: ``ReadableFileHandleProtocol/readChunks(in:chunkLength:)-2dz6``.
|
||||
/// - Returns: An `AsyncSequence` of chunks read from the file.
|
||||
public func readChunks(
|
||||
@@ -290,7 +285,6 @@ extension ReadableFileHandleProtocol {
|
||||
/// - Parameters:
|
||||
/// - range: A range of offsets in the file to read.
|
||||
/// - chunkLength: The length of chunks to read, defaults to 128 KiB.
|
||||
/// - as: Type of chunk to read.
|
||||
/// - SeeAlso: ``ReadableFileHandleProtocol/readChunks(in:chunkLength:)-2dz6``.
|
||||
/// - Returns: An `AsyncSequence` of chunks read from the file.
|
||||
public func readChunks(
|
||||
@@ -303,9 +297,7 @@ extension ReadableFileHandleProtocol {
|
||||
/// Returns an asynchronous sequence of chunks read from the file.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - range: A range of offsets in the file to read.
|
||||
/// - chunkLength: The length of chunks to read, defaults to 128 KiB.
|
||||
/// - as: Type of chunk to read.
|
||||
/// - SeeAlso: ``ReadableFileHandleProtocol/readChunks(in:chunkLength:)-2dz6``.
|
||||
/// - Returns: An `AsyncSequence` of chunks read from the file.
|
||||
public func readChunks(
|
||||
@@ -757,6 +749,7 @@ extension DirectoryFileHandleProtocol {
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - path: The path of the directory to open.
|
||||
/// - options: How the directory should be opened.
|
||||
/// - body: A closure which provides access to the directory.
|
||||
/// - Important: The handle passed to `execute` must not escape the closure.
|
||||
/// - Returns: The result of the `execute` closure.
|
||||
|
||||
@@ -189,6 +189,7 @@ public struct FileSystem: Sendable, FileSystemProtocol {
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - path: The path of the directory to open.
|
||||
/// - options: How the directory should be opened.
|
||||
/// - Returns: A handle to the opened directory.
|
||||
public func openDirectory(
|
||||
atPath path: FilePath,
|
||||
@@ -387,6 +388,7 @@ public struct FileSystem: Sendable, FileSystemProtocol {
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - path: The path to delete.
|
||||
/// - removeItemRecursively: Whether or not to remove items recursively.
|
||||
/// - Returns: The number of deleted items which may be zero if `path` did not exist.
|
||||
@discardableResult
|
||||
public func removeItem(
|
||||
@@ -546,7 +548,7 @@ public struct FileSystem: Sendable, FileSystemProtocol {
|
||||
/// Uses the `link(2)` system call.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - path: The path at which to create the symbolic link.
|
||||
/// - linkPath: The path at which to create the symbolic link.
|
||||
/// - destinationPath: The path that contains the item that the symbolic link points to.`
|
||||
public func createSymbolicLink(
|
||||
at linkPath: FilePath,
|
||||
@@ -647,7 +649,7 @@ extension NIOSingletons {
|
||||
/// The thread count is the system's available core count unless the environment variable
|
||||
/// `NIO_SINGLETON_FILESYSTEM_THREAD_COUNT` is set or this value was set manually by the user.
|
||||
///
|
||||
/// - note: This value must be set _before_ any singletons are used and must only be set once.
|
||||
/// - Note: This value must be set _before_ any singletons are used and must only be set once.
|
||||
@available(*, deprecated, renamed: "blockingPoolThreadCountSuggestion")
|
||||
public static var fileSystemThreadCountSuggestion: Int {
|
||||
set { Self.blockingPoolThreadCountSuggestion = newValue }
|
||||
|
||||
@@ -77,6 +77,7 @@ public protocol FileSystemProtocol: Sendable {
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - path: The path of the directory to open.
|
||||
/// - options: How the directory should be opened.
|
||||
/// - Returns: A handle to the opened directory.
|
||||
func openDirectory(
|
||||
atPath path: FilePath,
|
||||
@@ -181,7 +182,7 @@ public protocol FileSystemProtocol: Sendable {
|
||||
/// - Parameters:
|
||||
/// - sourcePath: The path to the item to copy.
|
||||
/// - destinationPath: The path at which to place the copy.
|
||||
/// - strategy: How to deal with concurrent aspects of the copy, only relevant to directories.
|
||||
/// - copyStrategy: How to deal with concurrent aspects of the copy, only relevant to directories.
|
||||
/// - shouldProceedAfterError: A closure which is executed to determine whether to continue
|
||||
/// copying files if an error is encountered during the operation. See Errors section for full details.
|
||||
/// - shouldCopyItem: A closure which is executed before each copy to determine whether each
|
||||
|
||||
Reference in new issue
Block a user