#[non_exhaustive]pub enum SendError {
StreamClosed,
Serialization(Box<dyn Error + Send + Sync + 'static>),
}Expand description
An error returned when sending a request over a stream fails.
Returned by RequestSender::send.
§Examples
fn handle_error(err: SendError) {
match err {
SendError::StreamClosed => {
println!("Stream closed; check ResponseStream for server status");
}
SendError::Serialization(e) => {
println!("Failed to serialize request: {e:?}");
}
_ => println!("Other send error"),
}
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
StreamClosed
The stream was closed by the server or receiver.
In bidirectional streaming, the underlying server status error (e.g., InvalidArgument,
PermissionDenied) is returned by ResponseStream::next.
Serialization(Box<dyn Error + Send + Sync + 'static>)
Serialization / proto conversion of the request failed.
Trait Implementations§
Source§impl Error for SendError
impl Error for SendError
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 !RefUnwindSafe for SendError
impl !UnwindSafe for SendError
impl Freeze for SendError
impl Send for SendError
impl Sync for SendError
impl Unpin for SendError
impl UnsafeUnpin for SendError
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