Skip to content

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

@darrenparkinson

Description

@darrenparkinson

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions