-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: trdthg <trdthg@outlook.com>
- Loading branch information
Showing
6 changed files
with
46 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ | |
*.iml | ||
target | ||
launch.json | ||
.local-chromium | ||
.local-chromium | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# chrono | ||
|
||
Codegen optionally support [chrono crate](https://docs.rs/chrono) with feature `chrono`. | ||
|
||
| :crab: Rust | :dart: Dart | | ||
| ----------- | ----------- | | ||
| `DateTime<Utc>` | `DateTime` *utc* | | ||
| `DateTime<Local>` | `DateTime` *local timezone* | | ||
| `NaiveDateTime` | `DateTime` *utc assumed* | | ||
| `Duration` | `Duration` | | ||
|
||
:warning: Please note that: | ||
|
||
- on native platforms, *microseconds* unit is used. | ||
- on web platform, *milliseconds* unit is used (due to JS limitation with dates). | ||
|
||
:bulb: Also a `DateTime<Local>` will always be translated into local time of the device, which might not be what you want if you expect them to be sent *as-is*. | ||
|
||
> In that case, you could implement it in your codebase by sending a `u32` (timezone offset) alongside the `i64` (timestamp) over the wire, or open a issue / PR here to further discuss it. The reason why this choice was originally made is to have all `DateTime<Utc>`, `DateTime<Local>` and `NaiveDateTime` been represented by a single `i64`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# uuid | ||
|
||
Codegen optionally support [uuid crate](https://docs.rs/uuid) with feature `uuid`. | ||
|
||
| :crab: Rust | :dart: Dart | | ||
| ----------- | ----------- | | ||
| `Uuid` | `UuidValue` see package [uuid](https://pub.dev/packages/uuid) | | ||
|
||
:warning: Please note that you need to add package [uuid](https://pub.dev/packages/uuid/install) to your Dart/Flutter dependencies in `pubspec.yaml` as well. | ||
|
||
:bulb: `Vec<Uuid>` implementation detail : all the uuids get concatenated as a single array of bytes for performance optimization. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters