StorageCrypto Documentation

Structure Flat​Map

public struct FlatMap<Parent: SingleEndpoint, Child: Endpoint>  

A struct defining a custom endpoint implementation handling a request generated by the response of a previous one.

This is only available for SingleEndpoint Parents cause we want to be sure to guarantee a deterministic ordering for outputs which is choerent with user expectations (i.e. work like Combine), and it wouldn't otherwise be possible by extending it to LoopEndpoints.

%31 FlatMap FlatMap LoopEndpoint LoopEndpoint FlatMap->LoopEndpoint Endpoint Endpoint FlatMap->Endpoint

Conforms To

Endpoint
LoopEndpoint

Nested Type Aliases

Output

public typealias Output = Child.Output

The associated output type.

Initializers

init(_:​to:​)

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

Init.

Parameters

parent () -> Parent

A valid Parent factory.

child @escaping (Parent.​Output) -> Child

A valid Child 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.