discontinuedPackage livekit_uniffi has been discontinued and replaced by livekit_ffi.

rustCallWithLifter<T, F> function

T rustCallWithLifter<T, F>(
  1. F ffiCall(
    1. Pointer<RustCallStatus>
    ),
  2. T lifter(
    1. F
    ), [
  3. UniffiRustCallStatusErrorHandler? errorHandler
])

Implementation

T rustCallWithLifter<T, F>(
  F Function(Pointer<RustCallStatus>) ffiCall,
  T Function(F) lifter, [
  UniffiRustCallStatusErrorHandler? errorHandler,
]) {
  final status = calloc<RustCallStatus>();
  try {
    final rawResult = ffiCall(status);
    checkCallStatus(errorHandler ?? NullRustCallStatusErrorHandler(), status);
    return lifter(rawResult);
  } finally {
    calloc.free(status);
  }
}