pub struct TransportError { /* private fields */ }Expand description
Error type for HTTP transport operations.
This wraps transport-specific errors (network failures, timeouts, etc.) in a common error type that the SDKs can handle uniformly.
Implementations§
Source§impl TransportError
impl TransportError
Sourcepub fn new(err: impl StdError + Send + Sync + 'static) -> Self
pub fn new(err: impl StdError + Send + Sync + 'static) -> Self
Create a new transport error from any error type.
This is used by transport implementations to wrap their specific error types
into the common TransportError type.
§Example
use launchdarkly_sdk_transport::TransportError;
use std::io;
let io_err = io::Error::new(io::ErrorKind::ConnectionRefused, "connection refused");
let transport_err = TransportError::new(io_err);Sourcepub fn inner(&self) -> &(dyn StdError + Send + Sync + 'static)
pub fn inner(&self) -> &(dyn StdError + Send + Sync + 'static)
Get a reference to the inner error.
Use this to access the underlying error for detailed inspection, logging, or to check for specific error types.
§Example
use launchdarkly_sdk_transport::TransportError;
use std::io;
fn diagnose_error(err: TransportError) {
let inner = err.inner();
// Check if it's an I/O error
if let Some(io_err) = inner.downcast_ref::<io::Error>() {
match io_err.kind() {
io::ErrorKind::TimedOut => println!("Operation timed out"),
io::ErrorKind::ConnectionRefused => println!("Connection refused"),
_ => println!("I/O error: {}", io_err),
}
} else {
println!("Other error: {}", inner);
}
}Trait Implementations§
Source§impl Debug for TransportError
impl Debug for TransportError
Source§impl Display for TransportError
impl Display for TransportError
Source§impl Error for TransportError
impl Error for TransportError
Source§fn source(&self) -> Option<&(dyn StdError + 'static)>
fn source(&self) -> Option<&(dyn StdError + '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 TransportError
impl !RefUnwindSafe for TransportError
impl Send for TransportError
impl Sync for TransportError
impl Unpin for TransportError
impl UnsafeUnpin for TransportError
impl !UnwindSafe for TransportError
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