StorageCrypto Documentation

Structure Handle​Events

public struct HandleEvents<Parent: Endpoint>  

A struct defining a custom endpoint implementation handling success and failures of an existing one, without modifying them.

%41 HandleEvents HandleEvents Endpoint Endpoint HandleEvents->Endpoint LoopEndpoint LoopEndpoint HandleEvents->LoopEndpoint

Conforms To

Endpoint
LoopEndpoint

Initializers

init(_:​with:​)

public init(
        @EndpointBuilder _ parent: () -> Parent,
        with handler: @escaping (Result<Parent.Output, any Error>) -> Void
    )  

Init.

Parameters

parent () -> Parent

A valid Parent factory.

handler @escaping (Result<Parent.​Output, any Error>) -> Void

The event handler.

Methods

_resolve(with:​)

@_spi(Private)
    public func _resolve<R: EndpointResolver>(with session: R) -> AsyncThrowingStream<Parent.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<Parent.Output, any Error>  

Fetch responses, from a given Input and URLSession.

Parameters

session R

The EndpointResolver used to fetch the response.

Returns

Some AsyncStream.