pub struct BootstrapManager { /* private fields */ }
Expand description
Bootstrap cache initialization and management
Implementations§
Source§impl BootstrapManager
impl BootstrapManager
Sourcepub async fn with_config(config: CacheConfig) -> Result<Self>
pub async fn with_config(config: CacheConfig) -> Result<Self>
Create a new bootstrap manager with custom configuration
Sourcepub async fn get_bootstrap_peers(
&self,
count: usize,
) -> Result<Vec<ContactEntry>>
pub async fn get_bootstrap_peers( &self, count: usize, ) -> Result<Vec<ContactEntry>>
Get bootstrap peers for initial connection
Sourcepub async fn add_contact(&mut self, contact: ContactEntry) -> Result<()>
pub async fn add_contact(&mut self, contact: ContactEntry) -> Result<()>
Add a discovered peer to the cache
Sourcepub async fn update_contact_metrics(
&mut self,
peer_id: &PeerId,
metrics: QualityMetrics,
) -> Result<()>
pub async fn update_contact_metrics( &mut self, peer_id: &PeerId, metrics: QualityMetrics, ) -> Result<()>
Update contact performance metrics
Sourcepub async fn start_background_tasks(&mut self) -> Result<()>
pub async fn start_background_tasks(&mut self) -> Result<()>
Start background maintenance tasks
Sourcepub async fn get_stats(&self) -> Result<CacheStats>
pub async fn get_stats(&self) -> Result<CacheStats>
Get cache statistics
Sourcepub async fn force_merge(&self) -> Result<MergeResult>
pub async fn force_merge(&self) -> Result<MergeResult>
Force a cache merge operation
Sourcepub fn encode_address(&self, multiaddr: &Multiaddr) -> Result<ThreeWordAddress>
pub fn encode_address(&self, multiaddr: &Multiaddr) -> Result<ThreeWordAddress>
Convert multiaddr to three-word address
Sourcepub fn decode_address(&self, words: &ThreeWordAddress) -> Result<Multiaddr>
pub fn decode_address(&self, words: &ThreeWordAddress) -> Result<Multiaddr>
Convert three-word address to multiaddr (requires registry lookup)
Sourcepub fn validate_words(&self, words: &ThreeWordAddress) -> Result<()>
pub fn validate_words(&self, words: &ThreeWordAddress) -> Result<()>
Validate three-word address format
Sourcepub fn word_encoder(&self) -> &WordEncoder
pub fn word_encoder(&self) -> &WordEncoder
Get the word encoder for direct access
Sourcepub fn get_well_known_word_addresses(
&self,
) -> Vec<(ThreeWordAddress, Multiaddr)>
pub fn get_well_known_word_addresses( &self, ) -> Vec<(ThreeWordAddress, Multiaddr)>
Get well-known bootstrap addresses as three-word addresses
Auto Trait Implementations§
impl Freeze for BootstrapManager
impl !RefUnwindSafe for BootstrapManager
impl Send for BootstrapManager
impl Sync for BootstrapManager
impl Unpin for BootstrapManager
impl !UnwindSafe for BootstrapManager
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