cynic/queries/
flatten.rs

1/// Encodes the rules for what types can be flattened into other types
2/// via the `#[cynic(flatten)]` attribute.
3///
4/// This trait is sealed and can't be implemented by users of cynic.
5pub trait FlattensInto<T>: private::Sealed<T> {}
6
7impl<T> FlattensInto<Vec<T>> for Vec<Option<T>> {}
8impl<T> FlattensInto<Vec<T>> for Option<Vec<T>> {}
9impl<T> FlattensInto<Option<Vec<T>>> for Option<Vec<Option<T>>> {}
10impl<T> FlattensInto<Vec<T>> for Option<Vec<Option<T>>> {}
11
12mod private {
13    pub trait Sealed<T> {}
14
15    impl<T> Sealed<Vec<T>> for Vec<Option<T>> {}
16    impl<T> Sealed<Vec<T>> for Option<Vec<T>> {}
17    impl<T> Sealed<Option<Vec<T>>> for Option<Vec<Option<T>>> {}
18    impl<T> Sealed<Vec<T>> for Option<Vec<Option<T>>> {}
19}