Structure
ForEach
public struct ForEach<Next: Sendable, Content: SingleEndpoint>
A struct defining a custom endpoint
implementation handling a sequence of
requests.
Relationships
Conforms To
LoopEndpoint
Nested Type Aliases
Initializers
init(_:content:)
public init<C: Collection>(
_ pages: C,
@EndpointBuilder content: @escaping (_ offset: Int, _ input: Next) -> Content
) where C.Element == Next
Init.
Parameters
| Name | Type | Description |
|---|---|---|
| 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
| Name | Type | Description |
|---|---|---|
| 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
| Name | Type | Description |
|---|---|---|
| session | R |
The |
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
| Name | Type | Description |
|---|---|---|
| session | R |
The |
Returns
Some AsyncStream.