exhaust/impls/
core_result.rs1use crate::patterns::delegate_factory_and_iter;
2use crate::Exhaust;
3
4impl<T: Exhaust, E: Exhaust> Exhaust for Result<T, E> {
5 delegate_factory_and_iter!(remote::Result<T, E>);
6
7 fn from_factory(factory: Self::Factory) -> Self {
8 match remote::Result::from_factory(factory) {
9 remote::Result::Ok(v) => Ok(v),
10 remote::Result::Err(v) => Err(v),
11 }
12 }
13}
14
15mod remote {
18 #[allow(missing_debug_implementations)] #[derive(crate::Exhaust)]
20 pub enum Result<T, E> {
21 Ok(T),
22 Err(E),
23 }
24}