Is there an elegant way to handle None with a type that cannot be inferred?

· Users Rust Lang · June 19, 2026, 2:22 a.m.
Summary
The author discusses challenges in designing a flexible API function that uses an optional observer for progress reporting. They encounter type inference issues when trying to pass `None` as an argument, consequently exploring potential solutions such as creating a `NoneObserver` type, but find it unintuitive. The post raises questions about the design patterns of optional parameters in Rust and seeks advice on better approaches.
AUTHOR
Sponsored
Zulip logo Zulip
Organized team chat for people who take work seriously. Topic-based threading keeps conversations focused.
Try Zulip
Become a sponsor →