either-or-both 0.3.1

The enums EitherOrBoth with the three variants Left, Right, Both and Either with the Left and Right variants
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! The crate's error

use core::fmt::Display;

#[derive(Debug, PartialEq, Eq, Clone, Copy)]
/// The error if converting from a 2-tuple of `Options` to [`crate::EitherOrBoth`] fails
pub struct TryFromOptionsError;

impl Display for TryFromOptionsError {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "Either the left, right or both values must be present")
    }
}

#[cfg(feature = "std")]
impl std::error::Error for TryFromOptionsError {}