Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
darrenparkinson opened this issue May 10, 2022 · 0 comments

Comments

@darrenparkinson
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant