pub struct TCError { /* private fields */ }
Expand description
A general error description.
Implementations§
source§impl TCError
impl TCError
sourcepub fn new<I>(code: ErrorKind, message: I) -> TCErrorwhere
I: Display,
pub fn new<I>(code: ErrorKind, message: I) -> TCErrorwhere
I: Display,
Returns a new error with the given code and message.
sourcepub fn with_stack<I, S, SI>(code: ErrorKind, message: I, stack: S) -> TCError
pub fn with_stack<I, S, SI>(code: ErrorKind, message: I, stack: S) -> TCError
Reconstruct a TCError
from its [ErrorType
] and data.
sourcepub fn bad_request<I>(info: I) -> TCErrorwhere
I: Display,
pub fn bad_request<I>(info: I) -> TCErrorwhere
I: Display,
Error to indicate a malformed or nonsensical request
sourcepub fn bad_gateway<I>(locator: I) -> TCErrorwhere
I: Display,
pub fn bad_gateway<I>(locator: I) -> TCErrorwhere
I: Display,
Error to convey an upstream problem
sourcepub fn conflict<I>(locator: I) -> TCErrorwhere
I: Display,
pub fn conflict<I>(locator: I) -> TCErrorwhere
I: Display,
Error to indicate that the requested resource is already locked
sourcepub fn method_not_allowed<M, S, P>(method: M, subject: S, path: P) -> TCError
pub fn method_not_allowed<M, S, P>(method: M, subject: S, path: P) -> TCError
Error to indicate that the requested resource exists but does not support the request method
sourcepub fn not_found<I>(locator: I) -> TCErrorwhere
I: Display,
pub fn not_found<I>(locator: I) -> TCErrorwhere
I: Display,
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>(value: V, expected: &str) -> TCErrorwhere
V: Debug,
pub fn unexpected<V>(value: V, expected: &str) -> TCErrorwhere
V: Debug,
Error to indicate an unexpected input value or type
sourcepub fn unsupported<I>(info: I) -> TCErrorwhere
I: Display,
pub fn unsupported<I>(info: I) -> TCErrorwhere
I: Display,
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) -> TCError
fn from(_: Infallible) -> TCError
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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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
.§impl<T> Pointable for T
impl<T> Pointable for 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
.