pub struct TCError { /* private fields */ }
Expand description
A general error description.
Implementations§
source§impl TCError
impl TCError
sourcepub fn new<I: Display>(code: ErrorKind, message: I) -> Self
pub fn new<I: Display>(code: ErrorKind, message: I) -> Self
Returns a new error with the given code and message.
sourcepub fn with_stack<I, S, SI>(code: ErrorKind, message: I, stack: S) -> Self
pub fn with_stack<I, S, SI>(code: ErrorKind, message: I, stack: S) -> Self
sourcepub fn bad_request<I: Display>(info: I) -> Self
pub fn bad_request<I: Display>(info: I) -> Self
Error to indicate a malformed or nonsensical request
sourcepub fn bad_gateway<I: Display>(locator: I) -> Self
pub fn bad_gateway<I: Display>(locator: I) -> Self
Error to convey an upstream problem
sourcepub fn conflict<I: Display>(info: I) -> Self
pub fn conflict<I: Display>(info: I) -> Self
Error to indicate that the requested resource is already locked
sourcepub fn method_not_allowed<M: Debug, P: Display>(method: M, path: P) -> Self
pub fn method_not_allowed<M: Debug, P: Display>(method: M, path: P) -> Self
Error to indicate that the requested resource exists but does not support the request method
sourcepub fn not_found<I: Display>(locator: I) -> Self
pub fn not_found<I: Display>(locator: I) -> Self
Error to indicate that the requested resource does not exist at the specified location
Error to indicate that the end-user is not authorized to perform the requested action
sourcepub fn unexpected<V: Debug>(value: V, expected: &str) -> Self
pub fn unexpected<V: Debug>(value: V, expected: &str) -> Self
Error to indicate an unexpected input value or type
sourcepub fn unsupported<I: Display>(info: I) -> Self
pub fn unsupported<I: Display>(info: I) -> Self
Error to indicate that the requested action cannot be performed due to technical limitations
Trait Implementations§
source§impl Error for TCError
impl Error for TCError
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<Infallible> for TCError
impl From<Infallible> for TCError
source§fn from(_: Infallible) -> Self
fn from(_: Infallible) -> Self
Converts to this type from the input type.
source§impl From<ParseError> for TCError
impl From<ParseError> for TCError
source§fn from(err: ParseError) -> Self
fn from(err: ParseError) -> Self
Converts to this type from the input type.
source§impl FromStream for TCError
impl FromStream for TCError
source§impl<'en> IntoStream<'en> for TCError
impl<'en> IntoStream<'en> for TCError
Auto Trait Implementations§
impl Freeze for TCError
impl RefUnwindSafe for TCError
impl Send for TCError
impl Sync for TCError
impl Unpin for TCError
impl UnwindSafe for TCError
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,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<F> Match for F
impl<F> Match for F
source§fn matches<T>(&self) -> boolwhere
T: TryCastFrom<Self>,
fn matches<T>(&self) -> boolwhere
T: TryCastFrom<Self>,
Returns
true
if self
can be cast into the target type T
.source§impl<F, T> TryCastFrom<F> for Twhere
T: CastFrom<F>,
impl<F, T> TryCastFrom<F> for Twhere
T: CastFrom<F>,
source§fn can_cast_from(_: &F) -> bool
fn can_cast_from(_: &F) -> bool
Test if
value
can be cast into Self
.source§fn opt_cast_from(f: F) -> Option<T>
fn opt_cast_from(f: F) -> Option<T>
Returns
Some(Self)
if the source value can be cast into Self
, otherwise None
.source§impl<F, T> TryCastInto<T> for Fwhere
T: TryCastFrom<F>,
impl<F, T> TryCastInto<T> for Fwhere
T: TryCastFrom<F>,
source§fn can_cast_into(&self) -> bool
fn can_cast_into(&self) -> bool
Test if
self
can be cast into T
.source§fn opt_cast_into(self) -> Option<T>
fn opt_cast_into(self) -> Option<T>
Returns
Some(T)
if self
can be cast into T
, otherwise None
.source§fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err>where
OnErr: FnOnce(&Self) -> Err,
fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err>where
OnErr: FnOnce(&Self) -> Err,
Returns
Ok(T)
if self
can be cast into T
, otherwise calls on_err
.