• Home
  • Raw
  • Download

Lines Matching refs:Either

40 pub use crate::Either::{Left, Right};
50 pub enum Either<L, R> { enum
85 $crate::Either::Left($pattern) => $result,
86 $crate::Either::Right($pattern) => $result,
134 impl<L: Clone, R: Clone> Clone for Either<L, R> { implementation
151 impl<L, R> Either<L, R> { implementation
228 pub fn as_ref(&self) -> Either<&L, &R> { in as_ref()
253 pub fn as_mut(&mut self) -> Either<&mut L, &mut R> { in as_mut()
262 pub fn as_pin_ref(self: Pin<&Self>) -> Either<Pin<&L>, Pin<&R>> { in as_pin_ref()
275 pub fn as_pin_mut(self: Pin<&mut Self>) -> Either<Pin<&mut L>, Pin<&mut R>> { in as_pin_mut()
300 pub fn flip(self) -> Either<R, L> { in flip()
319 pub fn map_left<F, M>(self, f: F) -> Either<M, R> in map_left()
341 pub fn map_right<F, S>(self, f: F) -> Either<L, S> in map_right()
419 pub fn left_and_then<F, S>(self, f: F) -> Either<S, R> in left_and_then()
421 F: FnOnce(L) -> Either<S, R>, in left_and_then()
440 pub fn right_and_then<F, S>(self, f: F) -> Either<L, S> in right_and_then()
442 F: FnOnce(R) -> Either<L, S>, in right_and_then()
461 pub fn into_iter(self) -> Either<L::IntoIter, R::IntoIter> in into_iter()
492 Either::Left(l) => l, in left_or()
493 Either::Right(_) => other, in left_or()
514 Either::Left(l) => l, in left_or_default()
515 Either::Right(_) => L::default(), in left_or_default()
536 Either::Left(l) => l, in left_or_else()
537 Either::Right(r) => f(r), in left_or_else()
561 Either::Left(_) => other, in right_or()
562 Either::Right(r) => r, in right_or()
583 Either::Left(_) => R::default(), in right_or_default()
584 Either::Right(r) => r, in right_or_default()
605 Either::Left(l) => f(l), in right_or_else()
606 Either::Right(r) => r, in right_or_else()
634 Either::Left(l) => l, in unwrap_left()
635 Either::Right(r) => { in unwrap_left()
665 Either::Right(r) => r, in unwrap_right()
666 Either::Left(l) => panic!("called `Either::unwrap_right()` on a `Left` value: {:?}", l), in unwrap_right()
694 Either::Left(l) => l, in expect_left()
695 Either::Right(r) => panic!("{}: {:?}", msg, r), in expect_left()
723 Either::Right(r) => r, in expect_right()
724 Either::Left(l) => panic!("{}: {:?}", msg, l), in expect_right()
746 Either::Left(l) => l.into(), in either_into()
747 Either::Right(r) => r.into(), in either_into()
752 impl<L, R> Either<Option<L>, Option<R>> { implementation
765 pub fn factor_none(self) -> Option<Either<L, R>> { in factor_none()
767 Left(l) => l.map(Either::Left), in factor_none()
768 Right(r) => r.map(Either::Right), in factor_none()
773 impl<L, R, E> Either<Result<L, E>, Result<R, E>> { impl
788 pub fn factor_err(self) -> Result<Either<L, R>, E> { in factor_err()
790 Left(l) => l.map(Either::Left), in factor_err()
791 Right(r) => r.map(Either::Right), in factor_err()
796 impl<T, L, R> Either<Result<T, L>, Result<T, R>> { impl
811 pub fn factor_ok(self) -> Result<T, Either<L, R>> { in factor_ok()
813 Left(l) => l.map_err(Either::Left), in factor_ok()
814 Right(r) => r.map_err(Either::Right), in factor_ok()
819 impl<T, L, R> Either<(T, L), (T, R)> { impl
832 pub fn factor_first(self) -> (T, Either<L, R>) { in factor_first()
840 impl<T, L, R> Either<(L, T), (R, T)> { implementation
853 pub fn factor_second(self) -> (Either<L, R>, T) { in factor_second()
861 impl<T> Either<T, T> { impl
888 pub fn map<F, M>(self, f: F) -> Either<M, M> in map()
900 impl<L, R> From<Result<R, L>> for Either<L, R> { implementation
911 impl<L, R> Into<Result<R, L>> for Either<L, R> { implementation
920 impl<L, R, A> Extend<A> for Either<L, R> implementation
934 impl<L, R> Iterator for Either<L, R> implementation
1026 impl<L, R> DoubleEndedIterator for Either<L, R> implementation
1055 impl<L, R> ExactSizeIterator for Either<L, R> implementation
1065 impl<L, R> iter::FusedIterator for Either<L, R> implementation
1073 impl<L, R> Future for Either<L, R> implementation
1092 impl<L, R> Read for Either<L, R> implementation
1118 impl<L, R> Seek for Either<L, R> implementation
1130 impl<L, R> BufRead for Either<L, R> implementation
1156 impl<L, R> Write for Either<L, R> implementation
1178 impl<L, R, Target> AsRef<Target> for Either<L, R> implementation
1191 impl<L, R> AsRef<$t> for Either<L, R>
1200 impl<L, R> AsMut<$t> for Either<L, R>
1227 impl<L, R, Target> AsRef<[Target]> for Either<L, R> implementation
1237 impl<L, R, Target> AsMut<Target> for Either<L, R> implementation
1247 impl<L, R, Target> AsMut<[Target]> for Either<L, R> implementation
1257 impl<L, R> Deref for Either<L, R> implementation
1269 impl<L, R> DerefMut for Either<L, R> implementation
1281 impl<L, R> Error for Either<L, R> implementation
1301 impl<L, R> fmt::Display for Either<L, R> implementation
1328 fn a() -> Either<u32, u32> { in macros()
1334 fn b() -> Either<String, &'static str> { in macros()
1345 let value: Either<String, &str> = Left(String::from("test")); in deref()
1440 check_ref::<Either<T1, T2>>()
1444 check_mut::<Either<T1, T2>>()
1457 check_array_ref::<Either<T1, T2>, _>() in _unsized_ref_propagation()
1461 check_array_mut::<Either<T1, T2>, _>() in _unsized_ref_propagation()