Structure
Map
public struct Map<Parent: Endpoint, Output>
A struct
defining a custom endpoint
implementation handling an output generated
from an existing one.
Relationships
Conforms To
Endpoint
LoopEndpoint
Initializers
init(_:to:)
public init(
@EndpointBuilder _ parent: () -> Parent,
to content: @escaping (Parent.Output) throws -> Output
)
Init.
Parameters
Name | Type | Description |
---|---|---|
parent | () -> Parent |
A valid |
content | @escaping (Parent.Output) throws -> Output |
A valid content factory. |
Methods
_resolve(with:)
@_spi(Private)
public func _resolve<R: EndpointResolver>(with session: R) -> AsyncThrowingStream<Output, any Error>
Fetch responses, from a given
Input
and URLSession
.
Parameters
Name | Type | Description |
---|---|---|
session | R |
The |
Returns
Some AsyncStream
.
_resolve(with:)
@_spi(Private)
public func _resolve<R: EndpointResolver>(with session: R) -> AnyPublisher<Output, any Error>
Fetch responses, from a given
Input
and URLSession
.
Parameters
Name | Type | Description |
---|---|---|
session | R |
The |
Returns
Some AsyncStream
.