pub enum BitrouterError {
UnsupportedFeature {
provider: String,
feature: String,
details: Option<String>,
},
Cancelled {
provider: Option<String>,
message: String,
},
InvalidRequest {
provider: Option<String>,
message: String,
body: Option<JsonValue>,
},
Transport {
provider: Option<String>,
message: String,
},
ResponseDecode {
provider: Option<String>,
message: String,
body: Option<JsonValue>,
},
InvalidResponse {
provider: Option<String>,
message: String,
body: Option<JsonValue>,
},
Provider {
provider: String,
message: String,
context: Box<ProviderErrorContext>,
},
StreamProtocol {
provider: Option<String>,
message: String,
chunk: Option<JsonValue>,
},
}Variants§
UnsupportedFeature
Cancelled
InvalidRequest
Transport
ResponseDecode
InvalidResponse
Provider
StreamProtocol
Implementations§
Source§impl BitrouterError
impl BitrouterError
pub fn cancelled(provider: Option<&str>, message: impl Into<String>) -> Self
pub fn unsupported( provider: impl Into<String>, feature: impl Into<String>, details: Option<String>, ) -> Self
pub fn invalid_request( provider: Option<&str>, message: impl Into<String>, body: Option<JsonValue>, ) -> Self
pub fn transport(provider: Option<&str>, message: impl Into<String>) -> Self
pub fn response_decode( provider: Option<&str>, message: impl Into<String>, body: Option<JsonValue>, ) -> Self
pub fn invalid_response( provider: Option<&str>, message: impl Into<String>, body: Option<JsonValue>, ) -> Self
pub fn provider_error( provider: impl Into<String>, message: impl Into<String>, context: ProviderErrorContext, ) -> Self
pub fn stream_protocol( provider: Option<&str>, message: impl Into<String>, chunk: Option<JsonValue>, ) -> Self
Trait Implementations§
Source§impl Clone for BitrouterError
impl Clone for BitrouterError
Source§fn clone(&self) -> BitrouterError
fn clone(&self) -> BitrouterError
Returns a duplicate of the value. Read more
1.0.0 · 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 BitrouterError
impl Debug for BitrouterError
Source§impl Display for BitrouterError
impl Display for BitrouterError
Source§impl Error for BitrouterError
impl Error for BitrouterError
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()
Auto Trait Implementations§
impl Freeze for BitrouterError
impl RefUnwindSafe for BitrouterError
impl Send for BitrouterError
impl Sync for BitrouterError
impl Unpin for BitrouterError
impl UnsafeUnpin for BitrouterError
impl UnwindSafe for BitrouterError
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§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more