Skip to main content
←API Reference ←com.nianticspatial.nsdk

NSDKResult


Declaration​

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

Summary​

ResultDeprecated wrapper for NSDK operations that can succeed or fail. NSDKResult is a Kotlin sealed class designed to provide a type-safe abstraction over the return values of low-level C APIs. Instead of directly handling raw integer status codes from the C layer, Kotlin callers receive structured results as either Success or Error.

Samples​

val result = NSDK.getVpsDevicePoseAsGeolocation(handle, pose)
when (result) {
is NSDKResult.Success -> {
val location = result.value
}
is NSDKResult.Error -> {
println("Failed to track anchor: $result.code")
}
}