Skip to content

Commit

Permalink
Organize code
Browse files Browse the repository at this point in the history
  • Loading branch information
temeddix committed Sep 12, 2024
1 parent 8a5ad7a commit 739694d
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions flutter_package/lib/src/load_os.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,20 @@ typedef SendDartSignalWrap = void Function(
int,
);

/// Abstract class for unifying the interface
/// for calling native functions.
abstract class RustLibrary {
void startRustLogic();
void stopRustLogic();
void prepareIsolate(int port);
void storeDartPostCObject(PostCObjectPtr postCObject);
void sendDartSignal(
int messageId,
Uint8List messageBytes,
Uint8List binary,
);
}

// Direct access to global function symbols loaded in the process.
// These are available only if the native library is
// loaded into global space with `RTLD_GLOBAL` configuration.
Expand Down Expand Up @@ -111,20 +125,6 @@ external void sendDartSignalExtern(
int binaryLength,
);

/// Abstract class for unifying the interface
/// for calling native functions.
abstract class RustLibrary {
void startRustLogic();
void stopRustLogic();
void prepareIsolate(int port);
void storeDartPostCObject(PostCObjectPtr postCObject);
void sendDartSignal(
int messageId,
Uint8List messageBytes,
Uint8List binary,
);
}

/// Class for global native library symbols loaded with `RTLD_GLOBAL`.
/// This is the efficient and ideal way to call native code.
/// `@Native` decorator with `isLeaf` parameter
Expand Down

0 comments on commit 739694d

Please sign in to comment.