Skip to content

Commit

Permalink
Update resources.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasKruckenberg committed Sep 10, 2023
1 parent 8d11e50 commit 7a2ee4b
Showing 1 changed file with 30 additions and 6 deletions.
36 changes: 30 additions & 6 deletions crates/gen-guest-rust/tests/resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,29 @@ pub mod resources {
pub struct A(u32);
impl A {
pub async fn f1(&self) {
::tauri_bindgen_guest_rust::invoke("resources;::resource::A", "f1", &())
::tauri_bindgen_guest_rust::invoke(
"resources::resource::a",
"f1",
&(self.0,),
)
.await
.unwrap()
}
pub async fn f2(&self, a: u32) {
::tauri_bindgen_guest_rust::invoke("resources;::resource::A", "f2", &(a))
::tauri_bindgen_guest_rust::invoke(
"resources::resource::a",
"f2",
&(self.0, a),
)
.await
.unwrap()
}
pub async fn f3(&self, a: u32, b: u32) {
::tauri_bindgen_guest_rust::invoke("resources;::resource::A", "f3", &(a, b))
::tauri_bindgen_guest_rust::invoke(
"resources::resource::a",
"f3",
&(self.0, a, b),
)
.await
.unwrap()
}
Expand All @@ -26,17 +38,29 @@ pub mod resources {
pub struct B(u32);
impl B {
pub async fn f1(&self) -> A {
::tauri_bindgen_guest_rust::invoke("resources;::resource::B", "f1", &())
::tauri_bindgen_guest_rust::invoke(
"resources::resource::b",
"f1",
&(self.0,),
)
.await
.unwrap()
}
pub async fn f2(&self, x: A) -> Result<u32, ()> {
::tauri_bindgen_guest_rust::invoke("resources;::resource::B", "f2", &(x))
::tauri_bindgen_guest_rust::invoke(
"resources::resource::b",
"f2",
&(self.0, x),
)
.await
.unwrap()
}
pub async fn f3(&self, x: Option<&'_ [A]>) -> Result<A, ()> {
::tauri_bindgen_guest_rust::invoke("resources;::resource::B", "f3", &(x))
::tauri_bindgen_guest_rust::invoke(
"resources::resource::b",
"f3",
&(self.0, x),
)
.await
.unwrap()
}
Expand Down

0 comments on commit 7a2ee4b

Please sign in to comment.