twonly-app/lib/core/bridge.dart

79 lines
2.5 KiB
Dart

// This file is automatically generated, so please do not edit it.
// @generated by `flutter_rust_bridge`@ 2.12.0.
// ignore_for_file: invalid_use_of_internal_member
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
import 'database/contact.dart';
import 'frb_generated.dart';
// These functions are ignored because they are not marked as `pub`: `get_workspace`
// These types are ignored because they are neither used by any `pub` functions nor (for structs and enums) marked `#[frb(unignore)]`: `Twonly`
Future<void> initializeTwonly({required TwonlyConfig config}) =>
RustLib.instance.api.crateBridgeInitializeTwonly(config: config);
Future<List<Contact>> getAllContacts() =>
RustLib.instance.api.crateBridgeGetAllContacts();
Future<OtherPromotion> loadPromotions() =>
RustLib.instance.api.crateBridgeLoadPromotions();
class OtherPromotion {
const OtherPromotion({
required this.promotionId,
required this.publicId,
required this.fromContactId,
required this.threshold,
required this.announcementShare,
this.publicKeyVerifiedTimestamp,
});
final int promotionId;
final PlatformInt64 publicId;
final PlatformInt64 fromContactId;
final int threshold;
final Uint8List announcementShare;
final PlatformInt64? publicKeyVerifiedTimestamp;
@override
int get hashCode =>
promotionId.hashCode ^
publicId.hashCode ^
fromContactId.hashCode ^
threshold.hashCode ^
announcementShare.hashCode ^
publicKeyVerifiedTimestamp.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is OtherPromotion &&
runtimeType == other.runtimeType &&
promotionId == other.promotionId &&
publicId == other.publicId &&
fromContactId == other.fromContactId &&
threshold == other.threshold &&
announcementShare == other.announcementShare &&
publicKeyVerifiedTimestamp == other.publicKeyVerifiedTimestamp;
}
class TwonlyConfig {
const TwonlyConfig({
required this.databasePath,
required this.dataDirectory,
});
final String databasePath;
final String dataDirectory;
@override
int get hashCode => databasePath.hashCode ^ dataDirectory.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is TwonlyConfig &&
runtimeType == other.runtimeType &&
databasePath == other.databasePath &&
dataDirectory == other.dataDirectory;
}