pub struct ResponseError { /* private fields */ }Expand description
Cloneable typed failure returned by a response stream and its completed future.
Implementations§
Source§impl ResponseError
impl ResponseError
Sourcepub fn service(error: impl Error + Send + Sync + 'static) -> ResponseError
pub fn service(error: impl Error + Send + Sync + 'static) -> ResponseError
Wraps a caller-composed Tower service error without erasing its source.
Sourcepub fn kind(&self) -> ResponseErrorKind
pub fn kind(&self) -> ResponseErrorKind
Returns the stable operation-level error class.
Sourcepub fn responses_error(&self) -> Option<&ResponsesError>
pub fn responses_error(&self) -> Option<&ResponsesError>
Returns the underlying provider or transport error when one exists.
This traverses caller middleware and the standard Tower service error, so callers do not need to downcast each possible service boundary.
Sourcepub fn is_context_window_exceeded(&self) -> bool
pub fn is_context_window_exceeded(&self) -> bool
Returns whether the provider rejected the request for context-window exhaustion.
Trait Implementations§
Source§impl Clone for ResponseError
impl Clone for ResponseError
Source§fn clone(&self) -> ResponseError
fn clone(&self) -> ResponseError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ResponseError
impl Debug for ResponseError
Source§impl Display for ResponseError
impl Display for ResponseError
Source§impl Error for ResponseError
impl Error for ResponseError
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 ResponseError
impl From<Infallible> for ResponseError
Source§fn from(error: Infallible) -> ResponseError
fn from(error: Infallible) -> ResponseError
Converts to this type from the input type.
Source§impl From<ResponseError> for NanocodexError
impl From<ResponseError> for NanocodexError
Source§fn from(source: ResponseError) -> Self
fn from(source: ResponseError) -> Self
Converts to this type from the input type.
Source§impl From<ResponsesError> for ResponseError
impl From<ResponsesError> for ResponseError
Source§fn from(error: ResponsesError) -> ResponseError
fn from(error: ResponsesError) -> ResponseError
Converts to this type from the input type.
Source§impl From<ResponsesServiceError> for ResponseError
impl From<ResponsesServiceError> for ResponseError
Source§fn from(error: ResponsesServiceError) -> ResponseError
fn from(error: ResponsesServiceError) -> ResponseError
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for ResponseError
impl !UnwindSafe for ResponseError
impl Freeze for ResponseError
impl Send for ResponseError
impl Sync for ResponseError
impl Unpin for ResponseError
impl UnsafeUnpin for ResponseError
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.