ModelListProvider

public protocol ModelListProvider

Warning

Although this has public access, it is intended for internal & codegen use and should not be used directly by host applications. The behavior of this may change without warning. Though it is not used by host application making any change to these public types should be backward compatible, otherwise it will be a breaking change.
  • Declaration

    Swift

    associatedtype Element : Model
  • Declaration

    Swift

    func getState() -> ModelListProviderState<Element>
  • load() Asynchronous

    Retrieve the array of Element from the data source asychronously.

    Declaration

    Swift

    func load() async throws -> [Element]
  • Check if there is subsequent data to retrieve. This method always returns false if the underlying provider is not loaded. Make sure the underlying data is loaded by calling load(completion) before calling this method. If true, the next page can be retrieved using getNextPage(completion:).

    Declaration

    Swift

    func hasNextPage() -> Bool
  • getNextPage() Asynchronous

    Asynchronously retrieve the next page as a new in-memory List object. Returns a failure if there is no next page of results. You can validate whether the list has another page with hasNextPage().

    Declaration

    Swift

    func getNextPage() async throws -> List<Element>
  • Custom encoder

    Declaration

    Swift

    func encode(to encoder: Encoder) throws
  • Declaration

    Swift

    func eraseToAnyModelListProvider() -> AnyModelListProvider<Element>