pub struct Error<TErrorData>where
TErrorData: Default,{ /* private fields */ }
Implementations§
source§impl<TErrorData> Error<TErrorData>where
TErrorData: Default,
impl<TErrorData> Error<TErrorData>where TErrorData: Default,
pub fn new(error: Box<dyn StdError + Send + Sync>) -> Self
pub fn new_with_data( error: Box<dyn StdError + Send + Sync>, data: TErrorData ) -> Self
pub fn empty() -> Self
pub fn as_result<TValue>() -> Result<TValue, Self>
pub fn get_status(&self) -> Option<u16>
pub fn status(self, status: u16) -> Self
pub fn body<TBody>(self, body: TBody) -> Selfwhere TBody: AsRef<str>,
pub fn get_body_bytes(&self) -> Option<&[u8]>
pub fn body_bytes(self, bytes: &[u8]) -> Self
pub fn get_error(&self) -> &(dyn StdError + Send + Sync)
pub fn error(self, error: Box<dyn StdError + Send + Sync>) -> Self
pub fn get_data(&self) -> &TErrorData
pub fn get_data_mut(&mut self) -> &mut TErrorData
pub fn data(self, data: TErrorData) -> Self
Trait Implementations§
source§impl<TErrorData> AsMut<TErrorData> for Error<TErrorData>where
TErrorData: Default + Send + Sync,
impl<TErrorData> AsMut<TErrorData> for Error<TErrorData>where TErrorData: Default + Send + Sync,
source§fn as_mut(&mut self) -> &mut TErrorData
fn as_mut(&mut self) -> &mut TErrorData
Converts this type into a mutable reference of the (usually inferred) input type.
source§impl<TErrorData> AsRef<TErrorData> for Error<TErrorData>where
TErrorData: Default + Send + Sync,
impl<TErrorData> AsRef<TErrorData> for Error<TErrorData>where TErrorData: Default + Send + Sync,
source§fn as_ref(&self) -> &TErrorData
fn as_ref(&self) -> &TErrorData
Converts this type into a shared reference of the (usually inferred) input type.
Auto Trait Implementations§
impl<TErrorData> !RefUnwindSafe for Error<TErrorData>
impl<TErrorData> Send for Error<TErrorData>where TErrorData: Send,
impl<TErrorData> Sync for Error<TErrorData>where TErrorData: Sync,
impl<TErrorData> Unpin for Error<TErrorData>where TErrorData: Unpin,
impl<TErrorData> !UnwindSafe for Error<TErrorData>
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