Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

rename

Manav Rathid1f2b635a4c0
diff --git a/mobile/apps/photos/flutter_rust_bridge.yaml b/mobile/apps/photos/flutter_rust_bridge.yaml
index 948e816559..66eb47b079 100644
--- a/mobile/apps/photos/flutter_rust_bridge.yaml
+++ b/mobile/apps/photos/flutter_rust_bridge.yaml
@@ -1,6 +1,7 @@
rust_input: crate::api
rust_root: rust/
dart_output: lib/src/rust
+dart_entrypoint_class_name: EntePhotosRust
dart_preamble: |
// ignore_for_file: require_trailing_commas
diff --git a/mobile/apps/photos/integration_test/ente_photos_rust_test.dart b/mobile/apps/photos/integration_test/ente_photos_rust_test.dart
index 99bf0623cf..b9a7af2a8f 100644
--- a/mobile/apps/photos/integration_test/ente_photos_rust_test.dart
+++ b/mobile/apps/photos/integration_test/ente_photos_rust_test.dart
@@ -7,7 +7,7 @@ void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
setUp(() async {
- await RustLib.init();
+ await EntePhotosRust.init();
});
test('Can call rust function', () {
diff --git a/mobile/apps/photos/lib/main.dart b/mobile/apps/photos/lib/main.dart
index 1d593b686c..86a1452264 100644
--- a/mobile/apps/photos/lib/main.dart
+++ b/mobile/apps/photos/lib/main.dart
@@ -68,7 +68,7 @@ bool _stopHearBeat = false;
void main() async {
debugRepaintRainbowEnabled = false;
- await RustLib.init();
+ await EntePhotosRust.init();
WidgetsFlutterBinding.ensureInitialized();
await rive.RiveNative.init();
MediaKit.ensureInitialized();
diff --git a/mobile/apps/photos/lib/utils/isolate/isolate_operations.dart b/mobile/apps/photos/lib/utils/isolate/isolate_operations.dart
index 6deba3d97a..bd939f82bb 100644
--- a/mobile/apps/photos/lib/utils/isolate/isolate_operations.dart
+++ b/mobile/apps/photos/lib/utils/isolate/isolate_operations.dart
@@ -12,7 +12,7 @@ import "package:photos/services/machine_learning/ml_result.dart";
import "package:photos/services/machine_learning/semantic_search/clip/clip_text_encoder.dart";
import "package:photos/services/machine_learning/semantic_search/clip/clip_text_tokenizer.dart";
import "package:photos/services/machine_learning/semantic_search/query_result.dart";
-import "package:photos/src/rust/frb_generated.dart" show RustLib;
+import "package:photos/src/rust/frb_generated.dart" show EntePhotosRust;
import "package:photos/utils/image_ml_util.dart";
import "package:photos/utils/ml_util.dart";
@@ -224,7 +224,7 @@ Future<dynamic> isolateFunction(
Future<void> _ensureRustLoaded() async {
final bool loaded = _isolateCache["rustLibLoaded"] as bool? ?? false;
if (!loaded) {
- await RustLib.init();
+ await EntePhotosRust.init();
_isolateCache["rustLibLoaded"] = true;
}
}
@@ -232,7 +232,7 @@ Future<void> _ensureRustLoaded() async {
void _ensureRustDisposed() {
final bool loaded = _isolateCache["rustLibLoaded"] as bool? ?? false;
if (loaded) {
- RustLib.dispose();
+ EntePhotosRust.dispose();
_isolateCache.remove("rustLibLoaded");
}
}
diff --git a/mobile/apps/photos/rust/Cargo.toml b/mobile/apps/photos/rust/Cargo.toml
index b37d6f7f10..c845295819 100644
--- a/mobile/apps/photos/rust/Cargo.toml
+++ b/mobile/apps/photos/rust/Cargo.toml
@@ -1,5 +1,5 @@
[package]
-name = "rust_lib_photos"
+name = "ente-photos-rust"
version = "0.0.1"
edition = "2024"