Skip to content

Commit 5ccefd7

Browse files
committed
Add Events::as_vec
Signed-off-by: Yuki Kishimoto <[email protected]>
1 parent 1d5b9c7 commit 5ccefd7

File tree

5 files changed

+392
-279
lines changed

5 files changed

+392
-279
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,22 @@
2323
2424
-->
2525

26+
## [Unreleased]
27+
28+
### Breaking changes
29+
30+
### Changed
31+
32+
### Added
33+
34+
* Add `Events::as_vec` ([Yuki Kishimoto])
35+
36+
### Fixed
37+
38+
### Removed
39+
40+
### Deprecated
41+
2642
## [v0.39.0]
2743

2844
### Changed

lib/src/rust/api/database/events.dart

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
1111

1212
// Rust type: RustOpaqueMoi<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<_Events>>
1313
abstract class Events implements RustOpaqueInterface {
14+
/// Clone and convert the collection to a vector of events.
15+
///
16+
/// Use `toVec` method if you want to avoid the clone and consume the `Events` object.
17+
List<Event> asVec();
18+
1419
/// Check if contains `Event`
1520
bool contains({required Event event});
1621

@@ -29,11 +34,11 @@ abstract class Events implements RustOpaqueInterface {
2934
/// In other words, the filter limit is respected only if the `Events` are related to the same
3035
/// list of filters.
3136
///
32-
/// This method consumes the old `Events` collection and returns a new one!
37+
/// **This method consumes the old `Events` collection and returns a new one!**
3338
Events merge({required Events other});
3439

35-
/// Convert the collection to vector of events.
40+
/// Convert the collection to a vector of events.
3641
///
37-
/// This method consumes the `Events` collection!
42+
/// **This method consumes the `Events` collection!**
3843
List<Event> toVec();
3944
}

0 commit comments

Comments
 (0)