rust_in_flutter library
This module supports communication with Rust. More specifically, sending requests to Rust and receiving stream signals from Rust are possible.
Classes
- Rinf
- Contains basic functionalities of this framework.
- RustRequest
- Request object that is sent from Dart to Rust.
- RustResponse
- Response object that is sent from Rust to Dart.
- RustSignal
- Holds the data that Rust streams to Dart.
Enums
- RustOperation
-
Available operations that a
RustRequest
object can hold. There are 4 options,Create
,Read
,Update
, andDelete
.
Properties
-
rustBroadcaster
→ StreamController<
RustSignal> -
Listens to a stream from Rust and broadcasts the data in Dart.
You can see the usage example at
https://pub.dev/packages/rinf/example.
final
Functions
-
requestToRust(
RustRequest rustRequest) → Future< RustResponse> -
Sends bytes data to Rust wrapped in
RustRequest
object with operation and address fields. This system follows the definition of RESTful API and is very similar to HTTP request. ReturnsRustResponse
object that is somehow calculated from the Rust side. If the Rust doesn't respond for 60 seconds, this function will return a failedRustResponse
object. You can see the usage example at https://pub.dev/packages/rinf/example.