askarSessionFetchKey function
Implementation
Future<AskarResult<KeyEntryListHandle>> askarSessionFetchKey(
SessionHandle handle,
String name,
bool forUpdate,
) async {
Pointer<Utf8> namePointer = nullptr;
try {
namePointer = name.toNativeUtf8();
final callback = newCallbackWithHandle();
final initialResult = nativeAskarSessionFetchKey(
handle.toInt(),
namePointer,
boolToInt(forUpdate),
callback.nativeCallable.nativeFunction,
callback.id,
);
final completedResult = await callback.handleResult(initialResult);
return AskarResult<KeyEntryListHandle>(
completedResult.errorCode,
KeyEntryListHandle(completedResult.value),
);
} finally {
freePointer(namePointer);
}
}