AnySink
public struct AnySink<Input, Failure> : SinkProtocol where Failure : Error
A type-erasing sink.
Use AnySink
to wrap a sink whose type has details you don’t want to
expose. This is typically the case when returning sinks from a function
or storing sinks in properties.
You can also use AnySink
to create a custom sink by providing a closure
for the pollSend
, pollFlush
and pollClose
methods, rather than
implementing SinkProtocol
directly on a custom type.
-
Declaration
Swift
public typealias Output = Result<Void, Sink.Completion<Failure>>
-
-
-
-
Creates a type-erasing sink implemented by the provided closures.
Declaration
Swift
@inlinable public init(pollSend: @escaping PollSendFn, pollFlush: @escaping PollFlushFn, pollClose: @escaping PollCloseFn)
-
Declaration
Swift
@inlinable public init<Base>(_ sink: Base) where Input == Base.Input, Failure == Base.Failure, Base : SinkProtocol
-
Declaration
-
-