Anyone using Rust for Ubuntu Touch apps?

I am trying to write an app for ubuntu touch and trying to use Rust instead of C++. I'm confused about how you gain access to the qml file fields. Looking for maybe an example of how this is done.

Here is current code:
another_label : qt_method!(fn another_label(&self) {
&self.label2.text = ("hello world").to_string().into();
}),

label2 is a field in the qml file but not part of the rust struct itself so I get error

error[E0070]: invalid left-hand side of assignment
--> src/main.rs:43:27
|
43 | &self.label2.text = ("hello world").to_string().into();
| ----------------- ^
| |
| cannot assign to this expression

error[E0609]: no field label2 on type &Greeter
--> src/main.rs:43:15
|
43 | &self.label2.text = ("hello world").to_string().into();
| ^^^^^^ unknown field
|

I don't really understand your question, but you would definitely not put an ampersand on the left-hand-side of an assignment like that.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.