pub enum ProtocolError {
InvalidHost(String),
InvalidKey(String),
RemoteFailed(String),
Unknown(String),
}Expand description
A helper type for protocol errors.
This is used to send and receive errors over the network. It is also used to serialize and deserialize errors.
It should not be sent / received over the network, as it
should be sent as a ProtocolMessage::Error message.
The type system should prevent this from happening.
Variants§
Implementations§
Source§impl ProtocolError
impl ProtocolError
Sourcepub async fn send_and_bail<T, R>(self, stream: &mut T) -> Res<R>where
T: BincodeSend,
pub async fn send_and_bail<T, R>(self, stream: &mut T) -> Res<R>where
T: BincodeSend,
Sends the error message and shuts down the stream.
Trait Implementations§
Source§impl Debug for ProtocolError
impl Debug for ProtocolError
Source§impl<'de> Deserialize<'de> for ProtocolError
impl<'de> Deserialize<'de> for ProtocolError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ProtocolError
impl Display for ProtocolError
Source§impl PartialEq for ProtocolError
impl PartialEq for ProtocolError
Source§impl Serialize for ProtocolError
impl Serialize for ProtocolError
impl Eq for ProtocolError
impl StructuralPartialEq for ProtocolError
Auto Trait Implementations§
impl Freeze for ProtocolError
impl RefUnwindSafe for ProtocolError
impl Send for ProtocolError
impl Sync for ProtocolError
impl Unpin for ProtocolError
impl UnwindSafe for ProtocolError
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