pub enum RPCError<NID: NodeId, N: Node, E: Error> {
Timeout(Timeout<NID>),
Network(NetworkError),
RemoteError(RemoteError<NID, N, E>),
}
Expand description
Error occurs when invoking a remote raft API.
Variants§
Implementations§
source§impl<NID, N, E> RPCError<NID, N, RaftError<NID, E>>where
NID: NodeId,
N: Node,
E: Error,
impl<NID, N, E> RPCError<NID, N, RaftError<NID, E>>where NID: NodeId, N: Node, E: Error,
sourcepub fn forward_to_leader(&self) -> Option<&ForwardToLeader<NID, N>>where
E: TryAsRef<ForwardToLeader<NID, N>>,
pub fn forward_to_leader(&self) -> Option<&ForwardToLeader<NID, N>>where E: TryAsRef<ForwardToLeader<NID, N>>,
Return a reference to ForwardToLeader error if Self::RemoteError contains one.
Trait Implementations§
source§impl<NID: NodeId, N: Node, E: Error> Display for RPCError<NID, N, E>where
Timeout<NID>: Display,
RemoteError<NID, N, E>: Display,
impl<NID: NodeId, N: Node, E: Error> Display for RPCError<NID, N, E>where Timeout<NID>: Display, RemoteError<NID, N, E>: Display,
source§impl<NID: NodeId, N: Node, E: Error> Error for RPCError<NID, N, E>where
Timeout<NID>: Error,
RemoteError<NID, N, E>: Error,
Self: Debug + Display,
impl<NID: NodeId, N: Node, E: Error> Error for RPCError<NID, N, E>where Timeout<NID>: Error, RemoteError<NID, N, E>: Error, Self: Debug + Display,
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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<NID: NodeId, N: Node, E: Error> From<NetworkError> for RPCError<NID, N, E>
impl<NID: NodeId, N: Node, E: Error> From<NetworkError> for RPCError<NID, N, E>
source§fn from(source: NetworkError) -> Self
fn from(source: NetworkError) -> Self
Converts to this type from the input type.
source§impl<NID: NodeId, N: Node, E: Error> From<RemoteError<NID, N, E>> for RPCError<NID, N, E>
impl<NID: NodeId, N: Node, E: Error> From<RemoteError<NID, N, E>> for RPCError<NID, N, E>
source§fn from(source: RemoteError<NID, N, E>) -> Self
fn from(source: RemoteError<NID, N, E>) -> Self
Converts to this type from the input type.
source§impl<NID: PartialEq + NodeId, N: PartialEq + Node, E: PartialEq + Error> PartialEq<RPCError<NID, N, E>> for RPCError<NID, N, E>
impl<NID: PartialEq + NodeId, N: PartialEq + Node, E: PartialEq + Error> PartialEq<RPCError<NID, N, E>> for RPCError<NID, N, E>
impl<NID: Eq + NodeId, N: Eq + Node, E: Eq + Error> Eq for RPCError<NID, N, E>
impl<NID: NodeId, N: Node, E: Error> StructuralEq for RPCError<NID, N, E>
impl<NID: NodeId, N: Node, E: Error> StructuralPartialEq for RPCError<NID, N, E>
Auto Trait Implementations§
impl<NID, N, E> RefUnwindSafe for RPCError<NID, N, E>where E: RefUnwindSafe, N: RefUnwindSafe, NID: RefUnwindSafe,
impl<NID, N, E> Send for RPCError<NID, N, E>where E: Send,
impl<NID, N, E> Sync for RPCError<NID, N, E>where E: Sync,
impl<NID, N, E> Unpin for RPCError<NID, N, E>where E: Unpin, N: Unpin, NID: Unpin,
impl<NID, N, E> UnwindSafe for RPCError<NID, N, E>where E: UnwindSafe, N: UnwindSafe, NID: UnwindSafe,
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.