Skip to main content

ARDK for Android/com.nianticlabs.ardk/AsyncResult

AsyncResult

sealed class AsyncResult<out TData, out TError : ErrorCodeProvider>

Represents the final result of a completed asynchronous operation, which can either be a success, a failure, or a timeout. * This is the public-facing result type returned by suspend functions. It intentionally omits an "in-progress" state, guaranteeing that the operation has reached a terminal state.

Parameters​

androidJvm

TDataThe type of the successful data.
TErrorThe type of the error code enum.

Inheritors​

Success
Error
Timeout

Types​

NameSummary
Error[androidJvm]
data class Error<out TData, out TError : ErrorCodeProvider>(val code: TError) : AsyncResult<TData, TError>
Represents a failed operation, containing an error code.
Success[androidJvm]
data class Success<out TData, out TError : ErrorCodeProvider>(val value: TData) : AsyncResult<TData, TError>
Represents a successful operation, containing the resulting value.
Timeout[androidJvm]
object Timeout : AsyncResult<Nothing, Nothing>
Represents an operation that failed because it exceeded its time limit. This is a singleton object as it carries no additional state.