tzmfreedom / rustforce

Salesforce REST API Client by Rust
MIT License
41 stars 19 forks source link

missing tokio dependency in example - `main` function is not allowed to be `async` #18

Open darrenparkinson opened 2 years ago

darrenparkinson commented 2 years ago

Hi, I'm very new to rust, so apologies if this is just something I should know, but to get the example going, I had to add a couple of things.

Firstly, it appears tokio is required for the async parts of the example but by default, it appears you can't make main async, so I had to add this to my cargo.toml dependencies:

tokio = { version = "1.18.2", features = ["full"] }

Additionally, I was using a sandbox, so I had to use the set_login_endpoint function:

let mut client = Client::new(client_id, client_secret);
client.set_login_endpoint("https://mydomain--uat.my.salesforce.com/");
client.login_with_credential(username, password).await?;

Otherwise, works great... Investigating the use of rust more widely, so checking to see if I can do everything I need -- this is definitely a tick in the box, thanks.