StorageCrypto Documentation

Structure Catch

public struct Catch<Parent: Endpoint, Child: SingleEndpoint> where Child.Output == Parent.Output  

A struct defining a custom endpoint implementation handling a request generated by an error in the previous one.

This is only available for SingleEndpoint Childs 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.

%169 Catch Catch LoopEndpoint LoopEndpoint Catch->LoopEndpoint Endpoint Endpoint Catch->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 (any Error) -> Child
    )  

Init.

Parameters

parent () -> Parent

A valid Parent factory.

child @escaping (any Error) -> 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.