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

gmail example gives credentials error method not found in impl std::future::Future #47

Open
Lejla94 opened this issue Nov 20, 2021 · 3 comments

Comments

@Lejla94
Copy link

Lejla94 commented Nov 20, 2021

I am using the example on github here for gmail.
I get the error:


credentials(creds)
^^^^^^^^^^^ method not found in `impl std::future::Future`

I am new to rust sorry.
I tried #[async_std::main] but it says i should use it only on main.
What could i do?

@Lejla94
Copy link
Author

Lejla94 commented Nov 20, 2021

my cargo toml

async-smtp = "0.4.0"
async-std = {version = "1.10.0", features = ["attributes"]}

@Moxinilian
Copy link

The examples are not up to date with the latest version of async_smtp it looks like.
As the error suggests, the SmtpClient new method now returns a future for a Result. So you should first await on that result, then unwrap the Result (in whatever way you'd like, for example using ? or matching on the error) to obtain the client instance.

@Lejla94
Copy link
Author

Lejla94 commented Nov 26, 2021

Now i am using tokio with lettre. But after i am good at Rust i will try this again to see what can i do.

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

2 participants