ResultProvider

struct ResultProvider<ResponseType> where ResponseType : Sendable
extension CommandBatcher.ResultProvider : Sendable

A structure that offers the ability to get the result of a command, once the batch request completes. It captures the result state, the response index and the ability to transform the result into a strongly typed response.

  • Undocumented

    Declaration

    Swift

    typealias Provider = () throws -> ResponseType
  • Returns true if the command was successful. This is a convenience method for the common case where the caller doesn’t care about the response, just whether the command was successful.

    Declaration

    Swift

    var isSuccessful: Bool { get }
  • Returns the response, or throws an error if the command was not successful.

    Declaration

    Swift

    func getOrThrow() throws -> ResponseType