Enum libp2p_kad::Caching
source · pub enum Caching {
Disabled,
Enabled {
max_peers: u16,
},
}
Expand description
The configuration for Kademlia “write-back” caching after successful
lookups via Behaviour::get_record
.
Variants§
Disabled
Caching is disabled and the peers closest to records being looked up
that do not return a record are not tracked, i.e.
GetRecordOk::FinishedWithNoAdditionalRecord
is always empty.
Enabled
Up to max_peers
peers not returning a record that are closest to the key
being looked up are tracked and returned in GetRecordOk::FinishedWithNoAdditionalRecord
.
The write-back operation must be performed explicitly, if
desired and after choosing a record from the results, via Behaviour::put_record_to
.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Caching
impl Send for Caching
impl Sync for Caching
impl Unpin for Caching
impl UnwindSafe for Caching
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