ProtocolSwift5.9.0
TextOutputStreamable
A source of text-streaming operations.
protocol TextOutputStreamable
Instances of types that conform to the TextOutputStreamable
protocol can write their value to instances of any type that conforms to the TextOutputStream
protocol. The Swift standard library’s text-related types, String
, Character
, and Unicode.Scalar
, all conform to TextOutputStreamable
.
Conforming to the TextOutputStreamable Protocol
To add TextOutputStreamable
conformance to a custom type, implement the required write(to:)
method. Call the given output stream’s write(_:)
method in your implementation.
Requirements
func write<Target>(to: inout Target
) Writes a textual representation of this instance into the given output stream.
Citizens in Swift
Subtypes
protocol StringProtocol
A type that can represent a string as a collection of characters.
Extension in SwiftSyntax
Subtypes
protocol BracedSyntax
protocol DeclGroupSyntax
protocol DeclSyntaxProtocol
Protocol to which all
DeclSyntax
nodes conform.protocol EffectSpecifiersSyntax
protocol ExprSyntaxProtocol
Protocol to which all
ExprSyntax
nodes conform.protocol FreestandingMacroExpansionSyntax
protocol MissingNodeSyntax
Represents a layout node that is missing in the source file.
protocol NamedDeclSyntax
protocol ParenthesizedSyntax
protocol PatternSyntaxProtocol
Protocol to which all
PatternSyntax
nodes conform.protocol RawDeclSyntaxNodeProtocol
protocol RawExprSyntaxNodeProtocol
protocol RawPatternSyntaxNodeProtocol
protocol RawStmtSyntaxNodeProtocol
protocol RawSyntaxNodeProtocol
All typed raw syntax nodes conform to this protocol.
RawXXXSyntax
is a typed wrappeer ofRawSyntax
.protocol RawTypeSyntaxNodeProtocol
protocol StmtSyntaxProtocol
Protocol to which all
StmtSyntax
nodes conform.protocol SyntaxChildChoices
Protocol for the enums nested inside
Syntax
nodes that enumerate all the possible types a child node might have.protocol SyntaxCollection
protocol SyntaxProtocol
Provide common functionality for specialized syntax nodes. Extend this protocol to provide common functionality for all syntax nodes. DO NOT CONFORM TO THIS PROTOCOL YOURSELF!
protocol TypeSyntaxProtocol
Protocol to which all
TypeSyntax
nodes conform.protocol WithAttributesSyntax
protocol WithCodeBlockSyntax
protocol WithGenericParametersSyntax
Syntax nodes that have generic parameters.
protocol WithModifiersSyntax
protocol WithStatementsSyntax
protocol WithTrailingCommaSyntax
Extension in SwiftParser
Subtypes
Extension in SwiftSyntaxBuilder
Subtypes
protocol DeclSyntaxParseable
Adds an initializer that allows the creation of declaration from string interpolations.