pub struct Maru;
Expand description
A placeholder type with a single value ◯
It mirrors the NoneError
type. For example, it is used in conjunction with Moral
to
represent the bad types for bool
or Option<T>
.
§Examples
Return Maru
from the right hand function to return None:
fn f() -> Option<i32> {
terror! { Some(3) => |_| { println!("Darn"); tear::Maru } };
}
It automatically converts to ()
:
fn f() -> () {
tear! { None => |_| tear::Maru }
}
§See also
- the
gut
function, that takes over the right-hand side
Trait Implementations§
impl Copy for Maru
Auto Trait Implementations§
impl Freeze for Maru
impl RefUnwindSafe for Maru
impl Send for Maru
impl Sync for Maru
impl Unpin for Maru
impl UnwindSafe for Maru
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