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
Reconstruct a TCError
from its [ErrorType
] and data.
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>(locator: I) -> Self
pub fn conflict<I: Display>(locator: I) -> Self
Error to indicate that the requested resource is already locked
sourcepub fn method_not_allowed<M: Debug, S: Debug, P: Display>(
method: M,
subject: S,
path: P
) -> Self
pub fn method_not_allowed<M: Debug, S: Debug, P: Display>( method: M, subject: S, 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)>
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<'en> IntoStream<'en> for TCError
impl<'en> IntoStream<'en> for TCError
Auto Trait Implementations§
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
§impl<T, F> CastInto<F> for Twhere
F: CastFrom<T>,
impl<T, F> CastInto<F> for Twhere
F: CastFrom<T>,
§impl<F> Match for F
impl<F> Match for F
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<F, T> TryCastFrom<F> for Twhere
T: CastFrom<F>,
impl<F, T> TryCastFrom<F> for Twhere
T: CastFrom<F>,
§fn can_cast_from(_: &F) -> bool
fn can_cast_from(_: &F) -> bool
Test if
value
can be cast into Self
.§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
.§fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err>
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err>
Returns
Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.§impl<F, T> TryCastInto<T> for Fwhere
T: TryCastFrom<F>,
impl<F, T> TryCastInto<T> for Fwhere
T: TryCastFrom<F>,
§fn can_cast_into(&self) -> bool
fn can_cast_into(&self) -> bool
Test if
self
can be cast into T
.§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
.§fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err>
fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err>
Returns
Ok(T)
if self
can be cast into T
, otherwise calls on_err
.