pub struct ErrorObject<'a> { /* private fields */ }Expand description
Implementations§
Source§impl<'a> ErrorObject<'a>
impl<'a> ErrorObject<'a>
Sourcepub fn owned<S: Serialize>(
code: i32,
message: impl Into<String>,
data: Option<S>,
) -> ErrorObject<'static>
pub fn owned<S: Serialize>( code: i32, message: impl Into<String>, data: Option<S>, ) -> ErrorObject<'static>
Create a new ErrorObjectOwned with optional data.
Sourcepub fn borrowed(
code: i32,
message: &'a str,
data: Option<&'a RawValue>,
) -> ErrorObject<'a>
pub fn borrowed( code: i32, message: &'a str, data: Option<&'a RawValue>, ) -> ErrorObject<'a>
Create a new ErrorObject with optional data.
Sourcepub fn into_owned(self) -> ErrorObject<'static>
pub fn into_owned(self) -> ErrorObject<'static>
Take ownership of the parameters within, if we haven’t already.
Sourcepub fn borrow(&'a self) -> ErrorObject<'a>
pub fn borrow(&'a self) -> ErrorObject<'a>
Borrow the current ErrorObject.
Trait Implementations§
Source§impl<'a> Clone for ErrorObject<'a>
impl<'a> Clone for ErrorObject<'a>
Source§impl<'a> Debug for ErrorObject<'a>
impl<'a> Debug for ErrorObject<'a>
Source§impl<'de, 'a> Deserialize<'de> for ErrorObject<'a>
impl<'de, 'a> Deserialize<'de> for ErrorObject<'a>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a> Display for ErrorObject<'a>
impl<'a> Display for ErrorObject<'a>
Source§impl<'a> Error for ErrorObject<'a>
impl<'a> Error for ErrorObject<'a>
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<!> for ErrorObject<'_>
impl From<!> for ErrorObject<'_>
Source§fn from(e: Infallible) -> Self
fn from(e: Infallible) -> Self
Converts to this type from the input type.
Source§impl From<ErrorCode> for ErrorObject<'_>
impl From<ErrorCode> for ErrorObject<'_>
Source§impl PartialEq for ErrorObject<'_>
impl PartialEq for ErrorObject<'_>
Auto Trait Implementations§
impl<'a> Freeze for ErrorObject<'a>
impl<'a> RefUnwindSafe for ErrorObject<'a>
impl<'a> Send for ErrorObject<'a>
impl<'a> Sync for ErrorObject<'a>
impl<'a> Unpin for ErrorObject<'a>
impl<'a> UnsafeUnpin for ErrorObject<'a>
impl<'a> UnwindSafe for ErrorObject<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 56 bytes