wrapper.rs
This file
Path
src/wrapper.rs
81 lines · 1.7 KiB · Rust
Last changed by
Merge pull request #319 from dtolnay/errorprovideDavid Tolnaybefore adoption8cf1d15
History of this fileTake it
The walk stopped after 200 commits: lines older than b1a6974 point at it.
Merge pull request #168 from Cyborus04/masterDavid Tolnaybefore adoptionb1a6974
lines 1–3why, one step back1use crate::StdError;2use core::fmt::{self, Debug, Display};3Merge pull request #266 from dtolnay/providerDavid Tolnaybefore adoption546342c
line 4why, one step back4#[cfg(backtrace)]Merge pull request #319 from dtolnay/errorprovideDavid Tolnaybefore adoption8cf1d15
line 5why, one step back5use std::error::Request;Merge pull request #266 from dtolnay/providerDavid Tolnaybefore adoption546342c
line 6why, one step back6Merge pull request #168 from Cyborus04/masterDavid Tolnaybefore adoptionb1a6974
lines 7–74why, one step back7#[repr(transparent)]8pub struct MessageError<M>(pub M);910impl<M> Debug for MessageError<M>11where12 M: Display + Debug,13{14 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {15 Debug::fmt(&self.0, f)16 }17}1819impl<M> Display for MessageError<M>20where21 M: Display + Debug,22{23 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {24 Display::fmt(&self.0, f)25 }26}2728impl<M> StdError for MessageError<M> where M: Display + Debug + 'static {}2930#[repr(transparent)]31pub struct DisplayError<M>(pub M);3233impl<M> Debug for DisplayError<M>34where35 M: Display,36{37 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {38 Display::fmt(&self.0, f)39 }40}4142impl<M> Display for DisplayError<M>43where44 M: Display,45{46 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {47 Display::fmt(&self.0, f)48 }49}5051impl<M> StdError for DisplayError<M> where M: Display + 'static {}5253#[cfg(feature = "std")]54#[repr(transparent)]55pub struct BoxedError(pub Box<dyn StdError + Send + Sync>);5657#[cfg(feature = "std")]58impl Debug for BoxedError {59 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {60 Debug::fmt(&self.0, f)61 }62}6364#[cfg(feature = "std")]65impl Display for BoxedError {66 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {67 Display::fmt(&self.0, f)68 }69}7071#[cfg(feature = "std")]72impl StdError for BoxedError {73 fn source(&self) -> Option<&(dyn StdError + 'static)> {74 self.0.source()Merge pull request #266 from dtolnay/providerDavid Tolnaybefore adoption546342c
lines 75–77why, one step back75 }7677 #[cfg(backtrace)]Merge pull request #319 from dtolnay/errorprovideDavid Tolnaybefore adoption8cf1d15
lines 78–79why, one step back78 fn provide<'a>(&'a self, request: &mut Request<'a>) {79 self.0.provide(request);Merge pull request #168 from Cyborus04/masterDavid Tolnaybefore adoptionb1a6974
lines 80–81why, one step back80 }81}