mirror of
https://github.com/apple/swift-async-algorithms
synced 2026-11-30 04:58:44 +00:00
Fix compilation errors in AsyncStreaming (#459)
* Fix compilation errors * Enable traits in CI
This commit is contained in:
1 parent
789dcf1f3d
commit
13713a4ffd
29 files changed
+137
-98
No files matched your search
@@ -25,7 +25,7 @@ public struct AsyncReaderInsufficientElementsError: Error, Hashable {
|
||||
public init() {}
|
||||
}
|
||||
|
||||
@available(macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2, *)
|
||||
@available(macOS 27.0, iOS 27.0, watchOS 27.0, tvOS 27.0, visionOS 27.0, *)
|
||||
extension AsyncReader where Self: ~Copyable, Self: ~Escapable, ReadElement: ~Copyable {
|
||||
/// Collects elements from the reader into the provided container, up to the
|
||||
/// container's available space.
|
||||
|
||||
@@ -11,10 +11,10 @@
|
||||
|
||||
#if UnstableAsyncStreaming && compiler(>=6.4)
|
||||
|
||||
public import ContainersPreview
|
||||
import ContainersPreview
|
||||
|
||||
// swift-format-ignore: AmbiguousTrailingClosureOverload
|
||||
@available(macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2, *)
|
||||
@available(macOS 27.0, iOS 27.0, watchOS 27.0, tvOS 27.0, visionOS 27.0, *)
|
||||
extension AsyncReader where Self: ~Copyable, Self: ~Escapable {
|
||||
/// Iterates over all chunks from the reader, executing the provided body for
|
||||
/// each buffer until the stream signals end-of-stream.
|
||||
|
||||
@@ -25,7 +25,7 @@ import ContainersPreview
|
||||
// writer across the read closure boundary) the constraint should be added
|
||||
// back so `pipe` works for `~Escapable` writers too.
|
||||
|
||||
@available(macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2, *)
|
||||
@available(macOS 27.0, iOS 27.0, watchOS 27.0, tvOS 27.0, visionOS 27.0, *)
|
||||
extension AsyncReader where Self: ~Copyable, Self: ~Escapable, Self.ReadElement: ~Copyable {
|
||||
/// Pipes all elements from this reader into the given writer, fusing the
|
||||
/// terminal chunk with a `finish` on the writer.
|
||||
|
||||
@@ -33,7 +33,7 @@ public import ContainersPreview
|
||||
///
|
||||
/// After the reader has emitted a non-`nil` `finalElement`, calling
|
||||
/// ``read(body:)`` again is a programmer error.
|
||||
@available(macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2, *)
|
||||
@available(macOS 27.0, iOS 27.0, watchOS 27.0, tvOS 27.0, visionOS 27.0, *)
|
||||
public protocol AsyncReader<ReadElement, ReadFailure, FinalElement>: ~Copyable, ~Escapable {
|
||||
/// The type of elements this reader reads.
|
||||
// TODO: Check if we should support ~Escapable elements
|
||||
|
||||
Reference in new issue
Block a user