Skip to content

Commit

Permalink
gen
Browse files Browse the repository at this point in the history
  • Loading branch information
fzyzcjy committed Sep 12, 2024
1 parent 2a764a1 commit cfb74c5
Show file tree
Hide file tree
Showing 8 changed files with 3,042 additions and 1,931 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@

// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import

import '../auxiliary/sample_types.dart';
import '../frb_generated.dart';
import '../lib.dart';
import 'misc_no_twin_example_b.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';

// These functions are ignored because they are not marked as `pub`: `log`
// These types are ignored because they are not used by any `pub` functions: `Issue2170Struct`
// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `clone`, `clone`, `fmt`, `fmt`
// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `clone`, `clone`, `clone`, `clone`, `fmt`, `fmt`, `fmt`

Future<void> sameFunctionNameInDifferentFiles() => RustLib.instance.api
.crateApiMiscNoTwinExampleASameFunctionNameInDifferentFiles();
Expand Down Expand Up @@ -210,3 +212,53 @@ class StructWithImplBlockInAnotherFile {
other is StructWithImplBlockInAnotherFile &&
runtimeType == other.runtimeType;
}

class StructWithRustAutoOpaqueFieldWithManyDerive {
final String content;

const StructWithRustAutoOpaqueFieldWithManyDerive({
required this.content,
});

static Future<StructWithRustAutoOpaqueFieldWithManyDerive> default_() => RustLib
.instance.api
.crateApiMiscNoTwinExampleAStructWithRustAutoOpaqueFieldWithManyDeriveDefault();

Future<void> f() => RustLib.instance.api
.crateApiMiscNoTwinExampleAStructWithRustAutoOpaqueFieldWithManyDeriveF(
that: this,
);

@override
int get hashCode => content.hashCode;

@override
bool operator ==(Object other) =>
identical(this, other) ||
other is StructWithRustAutoOpaqueFieldWithManyDerive &&
runtimeType == other.runtimeType &&
content == other.content;
}

class StructWithRustAutoOpaqueWithNonCloneData {
final NonCloneDataRaw content;

const StructWithRustAutoOpaqueWithNonCloneData({
required this.content,
});

Future<void> f() => RustLib.instance.api
.crateApiMiscNoTwinExampleAStructWithRustAutoOpaqueWithNonCloneDataF(
that: this,
);

@override
int get hashCode => content.hashCode;

@override
bool operator ==(Object other) =>
identical(this, other) ||
other is StructWithRustAutoOpaqueWithNonCloneData &&
runtimeType == other.runtimeType &&
content == other.content;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import '../frb_generated.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';

// Rust type: RustOpaqueMoi<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<NonCloneDataRaw>>
abstract class NonCloneDataRaw implements RustOpaqueInterface {}

enum MyEnum {
false_,
true_,
Expand Down
Loading

0 comments on commit cfb74c5

Please sign in to comment.