Nano_get handle error

Are you asking how to do this?

fn sender_60(sender: Sender) {

thread::spawn(move || {
error[E0412]: cannot find type `Sender` in this scope
   --> src/
276 |     fn every_60(sender: Sender) {
    |                         ^^^^^^

I have

let (sender, receiver) = glib::MainContext::channel(glib::PRIORITY_DEFAULT);

You need to import the Sender type, or use the full path.

If I use full path I have these errors:

error[E0109]: type arguments are not allowed for this type
   --> src/
276 |     fn every_60(sender: glib::MainContext::channel(glib::PRIORITY_DEFAULT)) {
    |                                                    ^^^^^^^^^^^^^^^^^^^^^^ type argument not allowed

error[E0223]: ambiguous associated type
   --> src/
276 |     fn every_60(sender: glib::MainContext::channel(glib::PRIORITY_DEFAULT)) {
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use fully-qualified syntax: `<glib::MainContext as Trait>::channel`

The full path is glib::Sender. You are asking some very basic questions, so I recommend you read a bit in the rust book, which explains many of these things. In particular you may want to read the chapter on functions.

Yes but glib::Sender return this error

error[E0107]: wrong number of type arguments: expected 1, found 0
   --> src/
276 |     fn every_60(sender: glib::Sender) {
    |                         ^^^^^^^^^^^^ expected 1 type argument

The messages sent by the channel have a specific type, and you need to specify that type with glib::Sender<InsertMessageTypeHere>.

ok thanks

I change my function like this:

fn every_60(sender: glib::Sender<Message>) {
        loop {
            let check = check_server();
            let text = String::from("PING OK");
            let _ = sender.send(Message::UpdateLabel(String::from(text)));

    async fn check_server() -> Result<(String)> {

        let response = reqwest::get("").await;
        println!("{:?}", response);

        match response {
            Ok(x) => Ok(String::from("ok")), // <- take out only the value
            Err(e) => Ok(String::from("error")),


There's a way to view result of variable check in function every_60?

You can return a value from the function.

Also if check_server is an async function?

Yes of course.

async fn returns_a_value() -> u32 {

stupid answer sorry: if my result is Ok("string") how can I parse into string.


You can match or unwrap the result.