pub struct ExitDisplay<E>(/* private fields */)
where
E: Display;
Expand description
A newtype wrapper around E: std::fmt::Display
ⓘ
fn main() -> Result<(), ExitDisplay<String>> {
Ok(some_fn()?)
}
fn some_fn() -> Result<(), String> {
Err("some error".into())
}
Trait Implementations§
Source§impl<E> Debug for ExitDisplay<E>where
E: Display,
Prints the underlying error type, using Display
and not Debug
.
impl<E> Debug for ExitDisplay<E>where
E: Display,
Prints the underlying error type, using Display
and not Debug
.
Source§impl<E> From<E> for ExitDisplay<E>where
E: Display,
impl<E> From<E> for ExitDisplay<E>where
E: Display,
Source§fn from(e: E) -> ExitDisplay<E>
fn from(e: E) -> ExitDisplay<E>
Converts to this type from the input type.
Auto Trait Implementations§
impl<E> Freeze for ExitDisplay<E>where
E: Freeze,
impl<E> RefUnwindSafe for ExitDisplay<E>where
E: RefUnwindSafe,
impl<E> Send for ExitDisplay<E>where
E: Send,
impl<E> Sync for ExitDisplay<E>where
E: Sync,
impl<E> Unpin for ExitDisplay<E>where
E: Unpin,
impl<E> UnwindSafe for ExitDisplay<E>where
E: 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