nu_utils/multilife.rs
1use std::ops::Deref;
2
3pub enum MultiLife<'out, 'local, T>
4where
5 'out: 'local,
6 T: ?Sized,
7{
8 Out(&'out T),
9 Local(&'local T),
10}
11
12impl<'out, 'local, T> Deref for MultiLife<'out, 'local, T>
13where
14 'out: 'local,
15 T: ?Sized,
16{
17 type Target = T;
18
19 fn deref(&self) -> &Self::Target {
20 match *self {
21 MultiLife::Out(x) => x,
22 MultiLife::Local(x) => x,
23 }
24 }
25}