Skip to content

Glossary: Rust Beyond the Basics

with_context

Also written: context, Context

An anyhow method that wraps an error with what you were doing, such as "reading prices.txt". It takes a closure so the message is built only on error; `.context` takes a ready-made message.

Where the book teaches it

Related terms

anyhowbail!