Nano_get handle error

Are you asking how to do this?

fn sender_60(sender: Sender) {
    ...
}

thread::spawn(move || {
    every_60(sender);
});
error[E0412]: cannot find type `Sender` in this scope
   --> src/main.rs:276:25
    |
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/main.rs:276:52
    |
276 |     fn every_60(sender: glib::MainContext::channel(glib::PRIORITY_DEFAULT)) {
    |                                                    ^^^^^^^^^^^^^^^^^^^^^^ type argument not allowed

error[E0223]: ambiguous associated type
   --> src/main.rs:276:25
    |
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/main.rs:276:25
    |
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)));
            thread::sleep(time::Duration::from_secs(10));
        }
    }

    #[tokio::main]
    async fn check_server() -> Result<(String)> {

        let response = reqwest::get("https://test.com").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 {
    10
}

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

Thanks

You can match or unwrap the result.