mqttBrokerEventListenerOnClientDisconnected function
void
mqttBrokerEventListenerOnClientDisconnected(
- int uniffiHandle,
- RustBuffer clientId,
- RustBuffer reason,
- Pointer<
Void> outReturn, - Pointer<
RustCallStatus> callStatus,
Implementation
void mqttBrokerEventListenerOnClientDisconnected(
int uniffiHandle,
RustBuffer clientId,
RustBuffer reason,
Pointer<Void> outReturn,
Pointer<RustCallStatus> callStatus,
) {
final status = callStatus.ref;
try {
final obj = FfiConverterCallbackInterfaceMqttBrokerEventListener._handleMap
.get(uniffiHandle);
final arg0 = FfiConverterString.lift(clientId);
final arg1 = FfiConverterString.lift(reason);
obj.onClientDisconnected(arg0, arg1);
status.code = CALL_SUCCESS;
} catch (e) {
status.code = CALL_UNEXPECTED_ERROR;
try {
status.errorBuf = FfiConverterString.lower(e.toString());
} catch (_) {
status.code = CALL_UNEXPECTED_ERROR;
try {
status.errorBuf = FfiConverterString.lower(
"uniffi: callback error could not be encoded",
);
} catch (_) {
status.errorBuf = Struct.create<RustBuffer>();
}
}
} finally {
uniffiFreeRustBuffer(clientId);
uniffiFreeRustBuffer(reason);
}
}