mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-07-31 17:01:58 +00:00
protocols/kad: Implement Error for GetRecordError (#2614)
This commit is contained in:
@@ -4,6 +4,10 @@
|
||||
|
||||
- Update to `libp2p-swarm` `v0.36.0`.
|
||||
|
||||
- Derive `Error` for `GetRecordError` (see [PR 2614]).
|
||||
|
||||
[pr 2614]: https://github.com/libp2p/rust-libp2p/pull/2614
|
||||
|
||||
# 0.36.0
|
||||
|
||||
- Update to `libp2p-swarm` `v0.35.0`.
|
||||
|
@@ -2555,17 +2555,20 @@ pub struct GetRecordOk {
|
||||
}
|
||||
|
||||
/// The error result of [`Kademlia::get_record`].
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, Error)]
|
||||
pub enum GetRecordError {
|
||||
#[error("the record was not found")]
|
||||
NotFound {
|
||||
key: record::Key,
|
||||
closest_peers: Vec<PeerId>,
|
||||
},
|
||||
#[error("the quorum failed; needed {quorum} peers")]
|
||||
QuorumFailed {
|
||||
key: record::Key,
|
||||
records: Vec<PeerRecord>,
|
||||
quorum: NonZeroUsize,
|
||||
},
|
||||
#[error("the request timed out")]
|
||||
Timeout {
|
||||
key: record::Key,
|
||||
records: Vec<PeerRecord>,
|
||||
|
Reference in New Issue
Block a user