pub enum Orwith<T> {
Neither,
With(T, T),
Or(T),
}Expand description
Represents one, another, or two values. (Addtionally, as an edgecase, the enum contains a Neither value.)
§Example
use orwith::Orwith;
let x:Option<&str> = Some("Hello!");
let y:Option<&str> = Some("Goodbye!");
let v = Orwith::orwith(x, y); // Orwith::With(...)Variants§
Neither
Neither option was chosen or both options were refused.
With(T, T)
Both options were preferred.
Or(T)
Only one option was preferred or the option not chosen was refused.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Orwith<T>where
T: Freeze,
impl<T> RefUnwindSafe for Orwith<T>where
T: RefUnwindSafe,
impl<T> Send for Orwith<T>where
T: Send,
impl<T> Sync for Orwith<T>where
T: Sync,
impl<T> Unpin for Orwith<T>where
T: Unpin,
impl<T> UnwindSafe for Orwith<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more