@@ -81,23 +81,26 @@ extension TextOutputStream {
81
81
82
82
/// A source of text-streaming operations.
83
83
///
84
- /// Instances of types that conform to the `Streamable` protocol can write
85
- /// their value to instances of any type that conforms to the `TextOutputStream`
86
- /// protocol. The Swift standard library's text-related types, `String`,
87
- /// `Character`, and `UnicodeScalar`, all conform to `Streamable`.
84
+ /// Instances of types that conform to the `TextOutputStreamable` protocol can
85
+ /// write their value to instances of any type that conforms to the
86
+ /// `TextOutputStream` protocol. The Swift standard library's text-related
87
+ /// types, `String`, `Character`, and `UnicodeScalar`, all conform to
88
+ /// `TextOutputStreamable`.
88
89
///
89
- /// Conforming to the Streamable Protocol
90
+ /// Conforming to the TextOutputStreamable Protocol
90
91
/// =====================================
91
92
///
92
- /// To add `Streamable ` conformance to a custom type, implement the required
93
- /// `write(to:)` method. Call the given output stream's `write(_:)` method in
94
- /// your implementation.
95
- public protocol Streamable {
93
+ /// To add `TextOutputStreamable ` conformance to a custom type, implement the
94
+ /// required `write(to:)` method. Call the given output stream's `write(_:)`
95
+ /// method in your implementation.
96
+ public protocol TextOutputStreamable {
96
97
/// Writes a textual representation of this instance into the given output
97
98
/// stream.
98
99
func write< Target : TextOutputStream > ( to target: inout Target )
99
100
}
100
- typealias TextOutputStreamable = Streamable
101
+
102
+ @available ( * , unavailable, renamed: " TextOutputStreamable " )
103
+ typealias Streamable = TextOutputStreamable
101
104
102
105
/// A type with a customized textual representation.
103
106
///
@@ -347,7 +350,7 @@ internal func _print_unlocked<T, TargetStream : TextOutputStream>(
347
350
debugPrintable. debugDescription. write ( to: & target)
348
351
return
349
352
}
350
- if case let streamableObject as Streamable = value {
353
+ if case let streamableObject as TextOutputStreamable = value {
351
354
streamableObject. write ( to: & target)
352
355
return
353
356
}
@@ -374,7 +377,7 @@ internal func _print_unlocked<T, TargetStream : TextOutputStream>(
374
377
/// This function is forbidden from being inlined because when building the
375
378
/// standard library inlining makes us drop the special semantics.
376
379
@inline ( never) @effects ( readonly)
377
- func _toStringReadOnlyStreamable< T : Streamable > ( _ x: T ) -> String {
380
+ func _toStringReadOnlyStreamable< T : TextOutputStreamable > ( _ x: T ) -> String {
378
381
var result = " "
379
382
x. write ( to: & result)
380
383
return result
@@ -403,7 +406,7 @@ public func _debugPrint_unlocked<T, TargetStream : TextOutputStream>(
403
406
return
404
407
}
405
408
406
- if let streamableObject = value as? Streamable {
409
+ if let streamableObject = value as? TextOutputStreamable {
407
410
streamableObject. write ( to: & target)
408
411
return
409
412
}
@@ -416,7 +419,8 @@ internal func _dumpPrint_unlocked<T, TargetStream : TextOutputStream>(
416
419
_ value: T , _ mirror: Mirror , _ target: inout TargetStream
417
420
) {
418
421
if let displayStyle = mirror. displayStyle {
419
- // Containers and tuples are always displayed in terms of their element count
422
+ // Containers and tuples are always displayed in terms of their element
423
+ // count
420
424
switch displayStyle {
421
425
case . tuple:
422
426
let count = mirror. children. count
@@ -449,7 +453,7 @@ internal func _dumpPrint_unlocked<T, TargetStream : TextOutputStream>(
449
453
return
450
454
}
451
455
452
- if let streamableObject = value as? Streamable {
456
+ if let streamableObject = value as? TextOutputStreamable {
453
457
streamableObject. write ( to: & target)
454
458
return
455
459
}
@@ -520,7 +524,7 @@ extension String : TextOutputStream {
520
524
// Streamables
521
525
//===----------------------------------------------------------------------===//
522
526
523
- extension String : Streamable {
527
+ extension String : TextOutputStreamable {
524
528
/// Writes the string into the given output stream.
525
529
///
526
530
/// - Parameter target: An output stream.
@@ -529,7 +533,7 @@ extension String : Streamable {
529
533
}
530
534
}
531
535
532
- extension Character : Streamable {
536
+ extension Character : TextOutputStreamable {
533
537
/// Writes the character into the given output stream.
534
538
///
535
539
/// - Parameter target: An output stream.
@@ -538,7 +542,7 @@ extension Character : Streamable {
538
542
}
539
543
}
540
544
541
- extension UnicodeScalar : Streamable {
545
+ extension UnicodeScalar : TextOutputStreamable {
542
546
/// Writes the textual representation of the Unicode scalar into the given
543
547
/// output stream.
544
548
///
@@ -569,7 +573,7 @@ internal struct _TeeStream<
569
573
@available ( * , unavailable, renamed: " TextOutputStream " )
570
574
public typealias OutputStreamType = TextOutputStream
571
575
572
- extension Streamable {
576
+ extension TextOutputStreamable {
573
577
@available ( * , unavailable, renamed: " write(to:) " )
574
578
public func writeTo< Target : TextOutputStream > ( _ target: inout Target ) {
575
579
Builtin . unreachable ( )
0 commit comments