StorageCrypto Documentation

Structure For​Each

public struct ForEach<Next: Sendable, Content: SingleEndpoint>  

A struct defining a custom endpoint implementation handling a sequence of requests.

%77 ForEach ForEach LoopEndpoint LoopEndpoint ForEach->LoopEndpoint

Conforms To

LoopEndpoint

Nested Type Aliases

Output

public typealias Output = Content.Output

The associated output type.

Initializers

init(_:​content:​)

public init<C: Collection>(
        _ pages: C,
        @EndpointBuilder content: @escaping (_ offset: Int, _ input: Next) -> Content
    ) where C.Element == Next  

Init.

Parameters

pages C

The collection of pages.

content @escaping (_ offset:​ Int, _ input:​ Next) -> Content

The actual endpoint request.

init(_:​content:​)

public init<C: Collection>(
        _ pages: C,
        @EndpointBuilder content: @escaping (Next) -> Content
    ) where C.Element == Next  

Init.

Parameters

pages C

The collection of pages.

content @escaping (Next) -> Content

The actual endpoint request.

Methods

resolve(with:​)

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:​)

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.