Request

public protocol Request : ProgressReporting

Protocol that represents a request made to the backend.

  • Indicates if a request still executing or not.

    Declaration

    Swift

    var executing: Bool { get }
  • Indicates if a request was cancelled or not.

    Declaration

    Swift

    var cancelled: Bool { get }
  • Cancels a request in progress.

    Declaration

    Swift

    func cancel()
  • Result Type expected for a specific request.

    Declaration

    Swift

    associatedtype ResultType
  • Result object expected for a specific request.

    Declaration

    Swift

    var result: ResultType? { get }
  • wait(timeout:) Extension method

    Returns true if the result is returned or false if the timeout ended before the result was returned.

    Declaration

    Swift

    @discardableResult
    public func wait(timeout: TimeInterval = TimeInterval.infinity) -> Bool
  • waitForResult(timeout:) Extension method

    Returns the ResultType if the result is returned or throws an Error.requestTimeout error if the timeout ended before the result was returned.

    Declaration

    Swift

    public func waitForResult(timeout: TimeInterval = TimeInterval.infinity) throws -> ResultType