Skip to content

Commit

Permalink
chore: update generated files
Browse files Browse the repository at this point in the history
  • Loading branch information
GregoryConrad committed Jan 9, 2023
1 parent ada3c62 commit 289dc1d
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 19 deletions.
5 changes: 4 additions & 1 deletion packages/flutter_mimir/ios/Classes/frb.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ void wire_search_documents(int64_t port_,
uint32_t *limit,
struct wire_list_sort_by *sort_criteria,
struct wire_Filter *filter,
int32_t matching_strategy);
int32_t *matching_strategy);

void wire_get_settings(int64_t port_,
struct wire_uint_8_list *instance_dir,
Expand All @@ -218,6 +218,8 @@ struct wire_Filter *new_box_autoadd_filter_0(void);

struct wire_MimirIndexSettings *new_box_autoadd_mimir_index_settings_0(void);

int32_t *new_box_autoadd_terms_matching_strategy_0(int32_t value);

uint32_t *new_box_autoadd_u32_0(uint32_t value);

struct wire_Filter *new_box_filter_0(void);
Expand Down Expand Up @@ -276,6 +278,7 @@ static int64_t dummy_method_to_enforce_bundling(void) {
dummy_var ^= ((int64_t) (void*) new_StringList_0);
dummy_var ^= ((int64_t) (void*) new_box_autoadd_filter_0);
dummy_var ^= ((int64_t) (void*) new_box_autoadd_mimir_index_settings_0);
dummy_var ^= ((int64_t) (void*) new_box_autoadd_terms_matching_strategy_0);
dummy_var ^= ((int64_t) (void*) new_box_autoadd_u32_0);
dummy_var ^= ((int64_t) (void*) new_box_filter_0);
dummy_var ^= ((int64_t) (void*) new_list_filter_0);
Expand Down
5 changes: 4 additions & 1 deletion packages/flutter_mimir/macos/Classes/frb.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ void wire_search_documents(int64_t port_,
uint32_t *limit,
struct wire_list_sort_by *sort_criteria,
struct wire_Filter *filter,
int32_t matching_strategy);
int32_t *matching_strategy);

void wire_get_settings(int64_t port_,
struct wire_uint_8_list *instance_dir,
Expand All @@ -218,6 +218,8 @@ struct wire_Filter *new_box_autoadd_filter_0(void);

struct wire_MimirIndexSettings *new_box_autoadd_mimir_index_settings_0(void);

int32_t *new_box_autoadd_terms_matching_strategy_0(int32_t value);

uint32_t *new_box_autoadd_u32_0(uint32_t value);

struct wire_Filter *new_box_filter_0(void);
Expand Down Expand Up @@ -276,6 +278,7 @@ static int64_t dummy_method_to_enforce_bundling(void) {
dummy_var ^= ((int64_t) (void*) new_StringList_0);
dummy_var ^= ((int64_t) (void*) new_box_autoadd_filter_0);
dummy_var ^= ((int64_t) (void*) new_box_autoadd_mimir_index_settings_0);
dummy_var ^= ((int64_t) (void*) new_box_autoadd_terms_matching_strategy_0);
dummy_var ^= ((int64_t) (void*) new_box_autoadd_u32_0);
dummy_var ^= ((int64_t) (void*) new_box_filter_0);
dummy_var ^= ((int64_t) (void*) new_list_filter_0);
Expand Down
13 changes: 7 additions & 6 deletions packages/mimir/lib/src/bridge_generated.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ abstract class EmbeddedMilli {
String? query,
int? limit,
List<SortBy>? sortCriteria,
required Filter filter,
required TermsMatchingStrategy matchingStrategy,
Filter? filter,
TermsMatchingStrategy? matchingStrategy,
dynamic hint});

FlutterRustBridgeTaskConstMeta get kSearchDocumentsConstMeta;
Expand Down Expand Up @@ -432,16 +432,17 @@ class EmbeddedMilliImpl implements EmbeddedMilli {
String? query,
int? limit,
List<SortBy>? sortCriteria,
required Filter filter,
required TermsMatchingStrategy matchingStrategy,
Filter? filter,
TermsMatchingStrategy? matchingStrategy,
dynamic hint}) {
var arg0 = _platform.api2wire_String(instanceDir);
var arg1 = _platform.api2wire_String(indexName);
var arg2 = _platform.api2wire_opt_String(query);
var arg3 = _platform.api2wire_opt_box_autoadd_u32(limit);
var arg4 = _platform.api2wire_opt_list_sort_by(sortCriteria);
var arg5 = _platform.api2wire_box_autoadd_filter(filter);
var arg6 = api2wire_terms_matching_strategy(matchingStrategy);
var arg5 = _platform.api2wire_opt_box_autoadd_filter(filter);
var arg6 = _platform
.api2wire_opt_box_autoadd_terms_matching_strategy(matchingStrategy);
return _platform.executeNormal(FlutterRustBridgeTask(
callFfi: (port_) => _platform.inner.wire_search_documents(
port_, arg0, arg1, arg2, arg3, arg4, arg5, arg6),
Expand Down
46 changes: 43 additions & 3 deletions packages/mimir/lib/src/bridge_generated.io.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ class EmbeddedMilliPlatform extends FlutterRustBridgeBase<EmbeddedMilliWire> {
return ptr;
}

@protected
ffi.Pointer<ffi.Int32> api2wire_box_autoadd_terms_matching_strategy(
TermsMatchingStrategy raw) {
return inner.new_box_autoadd_terms_matching_strategy_0(
api2wire_terms_matching_strategy(raw));
}

@protected
ffi.Pointer<ffi.Uint32> api2wire_box_autoadd_u32(int raw) {
return inner.new_box_autoadd_u32_0(api2wire_u32(raw));
Expand Down Expand Up @@ -94,6 +101,19 @@ class EmbeddedMilliPlatform extends FlutterRustBridgeBase<EmbeddedMilliWire> {
return raw == null ? ffi.nullptr : api2wire_StringList(raw);
}

@protected
ffi.Pointer<wire_Filter> api2wire_opt_box_autoadd_filter(Filter? raw) {
return raw == null ? ffi.nullptr : api2wire_box_autoadd_filter(raw);
}

@protected
ffi.Pointer<ffi.Int32> api2wire_opt_box_autoadd_terms_matching_strategy(
TermsMatchingStrategy? raw) {
return raw == null
? ffi.nullptr
: api2wire_box_autoadd_terms_matching_strategy(raw);
}

@protected
ffi.Pointer<ffi.Uint32> api2wire_opt_box_autoadd_u32(int? raw) {
return raw == null ? ffi.nullptr : api2wire_box_autoadd_u32(raw);
Expand Down Expand Up @@ -254,6 +274,11 @@ class EmbeddedMilliPlatform extends FlutterRustBridgeBase<EmbeddedMilliWire> {
api2wire_StringList(apiObj.disallowTyposOnFields);
}

void _api_fill_to_wire_opt_box_autoadd_filter(
Filter? apiObj, ffi.Pointer<wire_Filter> wireObj) {
if (apiObj != null) _api_fill_to_wire_box_autoadd_filter(apiObj, wireObj);
}

void _api_fill_to_wire_sort_by(SortBy apiObj, wire_SortBy wireObj) {
if (apiObj is SortBy_Asc) {
var pre_field0 = api2wire_String(apiObj.field0);
Expand Down Expand Up @@ -560,7 +585,7 @@ class EmbeddedMilliWire implements FlutterRustBridgeWireBase {
ffi.Pointer<ffi.Uint32> limit,
ffi.Pointer<wire_list_sort_by> sort_criteria,
ffi.Pointer<wire_Filter> filter,
int matching_strategy,
ffi.Pointer<ffi.Int32> matching_strategy,
) {
return _wire_search_documents(
port_,
Expand All @@ -584,7 +609,7 @@ class EmbeddedMilliWire implements FlutterRustBridgeWireBase {
ffi.Pointer<ffi.Uint32>,
ffi.Pointer<wire_list_sort_by>,
ffi.Pointer<wire_Filter>,
ffi.Int32)>>('wire_search_documents');
ffi.Pointer<ffi.Int32>)>>('wire_search_documents');
late final _wire_search_documents = _wire_search_documentsPtr.asFunction<
void Function(
int,
Expand All @@ -594,7 +619,7 @@ class EmbeddedMilliWire implements FlutterRustBridgeWireBase {
ffi.Pointer<ffi.Uint32>,
ffi.Pointer<wire_list_sort_by>,
ffi.Pointer<wire_Filter>,
int)>();
ffi.Pointer<ffi.Int32>)>();

void wire_get_settings(
int port_,
Expand Down Expand Up @@ -680,6 +705,21 @@ class EmbeddedMilliWire implements FlutterRustBridgeWireBase {
_new_box_autoadd_mimir_index_settings_0Ptr
.asFunction<ffi.Pointer<wire_MimirIndexSettings> Function()>();

ffi.Pointer<ffi.Int32> new_box_autoadd_terms_matching_strategy_0(
int value,
) {
return _new_box_autoadd_terms_matching_strategy_0(
value,
);
}

late final _new_box_autoadd_terms_matching_strategy_0Ptr =
_lookup<ffi.NativeFunction<ffi.Pointer<ffi.Int32> Function(ffi.Int32)>>(
'new_box_autoadd_terms_matching_strategy_0');
late final _new_box_autoadd_terms_matching_strategy_0 =
_new_box_autoadd_terms_matching_strategy_0Ptr
.asFunction<ffi.Pointer<ffi.Int32> Function(int)>();

ffi.Pointer<ffi.Uint32> new_box_autoadd_u32_0(
int value,
) {
Expand Down
26 changes: 22 additions & 4 deletions packages/mimir/lib/src/bridge_generated.web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ class EmbeddedMilliPlatform extends FlutterRustBridgeBase<EmbeddedMilliWire>
return api2wire_mimir_index_settings(raw);
}

@protected
int api2wire_box_autoadd_terms_matching_strategy(TermsMatchingStrategy raw) {
return api2wire_terms_matching_strategy(raw);
}

@protected
int api2wire_box_autoadd_u32(int raw) {
return api2wire_u32(raw);
Expand Down Expand Up @@ -139,6 +144,19 @@ class EmbeddedMilliPlatform extends FlutterRustBridgeBase<EmbeddedMilliWire>
return raw == null ? null : api2wire_StringList(raw);
}

@protected
List<dynamic>? api2wire_opt_box_autoadd_filter(Filter? raw) {
return raw == null ? null : api2wire_box_autoadd_filter(raw);
}

@protected
int? api2wire_opt_box_autoadd_terms_matching_strategy(
TermsMatchingStrategy? raw) {
return raw == null
? null
: api2wire_box_autoadd_terms_matching_strategy(raw);
}

@protected
int? api2wire_opt_box_autoadd_u32(int? raw) {
return raw == null ? null : api2wire_box_autoadd_u32(raw);
Expand Down Expand Up @@ -215,8 +233,8 @@ class EmbeddedMilliWasmModule implements WasmModule {
String? query,
int? limit,
List<dynamic>? sort_criteria,
List<dynamic> filter,
int matching_strategy);
List<dynamic>? filter,
int? matching_strategy);

external dynamic /* void */ wire_get_settings(
NativePortType port_, String instance_dir, String index_name);
Expand Down Expand Up @@ -273,8 +291,8 @@ class EmbeddedMilliWire
String? query,
int? limit,
List<dynamic>? sort_criteria,
List<dynamic> filter,
int matching_strategy) =>
List<dynamic>? filter,
int? matching_strategy) =>
wasmModule.wire_search_documents(port_, instance_dir, index_name, query,
limit, sort_criteria, filter, matching_strategy);

Expand Down
29 changes: 25 additions & 4 deletions packages/mimir/native/src/bridge_generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ fn wire_search_documents_impl(
query: impl Wire2Api<Option<String>> + UnwindSafe,
limit: impl Wire2Api<Option<u32>> + UnwindSafe,
sort_criteria: impl Wire2Api<Option<Vec<SortBy>>> + UnwindSafe,
filter: impl Wire2Api<Filter> + UnwindSafe,
matching_strategy: impl Wire2Api<TermsMatchingStrategy> + UnwindSafe,
filter: impl Wire2Api<Option<Filter>> + UnwindSafe,
matching_strategy: impl Wire2Api<Option<TermsMatchingStrategy>> + UnwindSafe,
) {
FLUTTER_RUST_BRIDGE_HANDLER.wrap(
WrapInfo {
Expand Down Expand Up @@ -422,7 +422,7 @@ mod web {
limit: JsValue,
sort_criteria: JsValue,
filter: JsValue,
matching_strategy: i32,
matching_strategy: JsValue,
) {
wire_search_documents_impl(
port_,
Expand Down Expand Up @@ -581,6 +581,11 @@ mod web {
self.map(Wire2Api::wire2api)
}
}
impl Wire2Api<Option<Filter>> for JsValue {
fn wire2api(self) -> Option<Filter> {
(!self.is_undefined() && !self.is_null()).then(|| self.wire2api())
}
}

impl Wire2Api<Option<Vec<SortBy>>> for JsValue {
fn wire2api(self) -> Option<Vec<SortBy>> {
Expand Down Expand Up @@ -650,6 +655,11 @@ mod web {
(!self.is_undefined() && !self.is_null()).then(|| self.wire2api())
}
}
impl Wire2Api<Option<TermsMatchingStrategy>> for JsValue {
fn wire2api(self) -> Option<TermsMatchingStrategy> {
(!self.is_undefined() && !self.is_null()).then(|| self.wire2api())
}
}
impl Wire2Api<Option<u32>> for JsValue {
fn wire2api(self) -> Option<u32> {
(!self.is_undefined() && !self.is_null()).then(|| self.wire2api())
Expand Down Expand Up @@ -768,7 +778,7 @@ mod io {
limit: *mut u32,
sort_criteria: *mut wire_list_sort_by,
filter: *mut wire_Filter,
matching_strategy: i32,
matching_strategy: *mut i32,
) {
wire_search_documents_impl(
port_,
Expand Down Expand Up @@ -822,6 +832,11 @@ mod io {
support::new_leak_box_ptr(wire_MimirIndexSettings::new_with_null_ptr())
}

#[no_mangle]
pub extern "C" fn new_box_autoadd_terms_matching_strategy_0(value: i32) -> *mut i32 {
support::new_leak_box_ptr(value)
}

#[no_mangle]
pub extern "C" fn new_box_autoadd_u32_0(value: u32) -> *mut u32 {
support::new_leak_box_ptr(value)
Expand Down Expand Up @@ -900,6 +915,12 @@ mod io {
Wire2Api::<MimirIndexSettings>::wire2api(*wrap).into()
}
}
impl Wire2Api<TermsMatchingStrategy> for *mut i32 {
fn wire2api(self) -> TermsMatchingStrategy {
let wrap = unsafe { support::box_from_leak_ptr(self) };
Wire2Api::<TermsMatchingStrategy>::wire2api(*wrap).into()
}
}
impl Wire2Api<u32> for *mut u32 {
fn wire2api(self) -> u32 {
unsafe { *support::box_from_leak_ptr(self) }
Expand Down

0 comments on commit 289dc1d

Please sign in to comment.