[−][src]Trait expected::FutureExpectedExt
An extension trait for Future
s that provides an adaptor for tracking
that all expectations are satisfied.
Provided methods
ⓘImportant traits for Expected<Fut>fn expected(self) -> Expected<Self>
ⓘImportant traits for Expected<Fut>
See that all expectations are satisfied until the future is completed.
Example
use expected::{expect, expect_eq}; use expected::FutureExpectedExt as _; let name = "Alice"; let country = "Wonderland"; let age = 14; let fut = async { expect_eq!(name, "Alice"); expect!(country.contains("land")); // ... expect!(age >= 20); }; let (_, disappoints) = fut.expected().await; if let Some(disappoints) = disappoints { eprintln!("{}", disappoints); }