Requests Documentation

Structure Map

public struct Map<Parent: Endpoint, Output>  

A struct defining a custom endpoint implementation handling an output generated from an existing one.

%3 Map Map LoopEndpoint LoopEndpoint Map->LoopEndpoint Endpoint Endpoint Map->Endpoint

Conforms To

Endpoint
LoopEndpoint

Initializers

init(_:​to:​)

public init(
        @EndpointBuilder _ parent: () -> Parent,
        to content: @escaping (Parent.Output) throws -> Output
    )  

Init.

Parameters

parent () -> Parent

A valid Parent factory.

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

session R

The EndpointResolver used to fetch the response.

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

session R

The EndpointResolver used to fetch the response.

Returns

Some AsyncStream.