pub struct IrohBackend { /* private fields */ }Expand description
Backend Iroh Otimizado
Backend IPFS de alta performance com otimizações nativas:
- Cache multinível com compressão inteligente
- Pool de conexões com circuit breaking
- Processamento em batch para máximo throughput
- Monitoramento contínuo de performance
Implementations§
Source§impl IrohBackend
impl IrohBackend
Sourcepub async fn new(config: &ClientConfig) -> Result<Self>
pub async fn new(config: &ClientConfig) -> Result<Self>
Sourcepub async fn get_swarm_manager(
&self,
) -> Result<Arc<RwLock<Option<SwarmManager>>>>
pub async fn get_swarm_manager( &self, ) -> Result<Arc<RwLock<Option<SwarmManager>>>>
Obtém referência para o SwarmManager se disponível
Sourcepub async fn get_topic_mesh_peers(&self, topic: &str) -> Result<Vec<PeerId>>
pub async fn get_topic_mesh_peers(&self, topic: &str) -> Result<Vec<PeerId>>
Obtém peers do mesh do Gossipsub para um tópico específico
Sourcepub async fn publish_gossip(&self, topic: &str, data: &[u8]) -> Result<()>
pub async fn publish_gossip(&self, topic: &str, data: &[u8]) -> Result<()>
Publica mensagem em tópico Gossipsub
Sourcepub async fn subscribe_gossip(&self, topic: &str) -> Result<()>
pub async fn subscribe_gossip(&self, topic: &str) -> Result<()>
Subscreve a um tópico Gossipsub
Sourcepub async fn discover_peer_integrated(
&self,
node_id: NodeId,
) -> Result<Vec<NodeAddr>>
pub async fn discover_peer_integrated( &self, node_id: NodeId, ) -> Result<Vec<NodeAddr>>
Descobre peers usando sistema integrado DHT + Discovery
Sourcepub async fn publish_node_integrated(&self, node_data: &NodeData) -> Result<u32>
pub async fn publish_node_integrated(&self, node_data: &NodeData) -> Result<u32>
Publica informações do nó no sistema integrado
Sourcepub async fn get_active_discoveries_status(
&self,
) -> Result<HashMap<NodeId, DiscoveryStatus>>
pub async fn get_active_discoveries_status( &self, ) -> Result<HashMap<NodeId, DiscoveryStatus>>
Obtém status das descobertas ativas
Sourcepub async fn force_dht_sync(&self) -> Result<()>
pub async fn force_dht_sync(&self) -> Result<()>
Força sincronização DHT com todas as sessões ativas
Source§impl IrohBackend
impl IrohBackend
Sourcepub async fn discover_peer_with_concrete_endpoint(
&mut self,
node_id: NodeId,
) -> Result<Vec<NodeAddr>>
pub async fn discover_peer_with_concrete_endpoint( &mut self, node_id: NodeId, ) -> Result<Vec<NodeAddr>>
Descobre um peer específico
Sourcepub async fn get_discovery_cache_statistics(
&self,
) -> Result<DiscoveryCacheStats>
pub async fn get_discovery_cache_statistics( &self, ) -> Result<DiscoveryCacheStats>
Obtém estatísticas do cache LRU de discovery
Sourcepub async fn get_cache_statistics(&self) -> Result<SimpleCacheStats>
pub async fn get_cache_statistics(&self) -> Result<SimpleCacheStats>
Obtém estatísticas do cache otimizado
Sourcepub async fn optimize_performance(&self) -> Result<()>
pub async fn optimize_performance(&self) -> Result<()>
Executa otimização automática de performance
Sourcepub async fn get_config_info(&self) -> String
pub async fn get_config_info(&self) -> String
Utiliza configuração para ajustes dinâmicos
Sourcepub async fn get_connection_pool_status(&self) -> String
pub async fn get_connection_pool_status(&self) -> String
Obtém informações do pool de conexões
Sourcepub async fn discovery_by_method(
&self,
node_id: NodeId,
method: DiscoveryMethod,
) -> Result<Vec<String>>
pub async fn discovery_by_method( &self, node_id: NodeId, method: DiscoveryMethod, ) -> Result<Vec<String>>
Executa discovery específico por método
Sourcepub async fn get_discovery_stats(&self) -> String
pub async fn get_discovery_stats(&self) -> String
Obtém estatísticas do sistema de discovery como String formatada
Sourcepub async fn get_performance_monitor_status(&self) -> String
pub async fn get_performance_monitor_status(&self) -> String
Obtém status do monitor de performance
Sourcepub async fn generate_performance_report(&self) -> String
pub async fn generate_performance_report(&self) -> String
Gera relatório detalhado de performance
Source§impl IrohBackend
impl IrohBackend
Sourcepub fn create_pubsub_interface(self: Arc<Self>) -> IrohPubSub
pub fn create_pubsub_interface(self: Arc<Self>) -> IrohPubSub
Cria uma interface PubSub para este backend
Trait Implementations§
Source§impl IpfsBackend for IrohBackend
impl IpfsBackend for IrohBackend
Source§fn add<'life0, 'async_trait>(
&'life0 self,
data: Pin<Box<dyn AsyncRead + Send>>,
) -> Pin<Box<dyn Future<Output = Result<AddResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn add<'life0, 'async_trait>(
&'life0 self,
data: Pin<Box<dyn AsyncRead + Send>>,
) -> Pin<Box<dyn Future<Output = Result<AddResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn cat<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn AsyncRead + Send>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn cat<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn AsyncRead + Send>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn pin_add<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn pin_add<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn pin_rm<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn pin_rm<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn pin_ls<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<PinInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn pin_ls<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<PinInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn connect<'life0, 'life1, 'async_trait>(
&'life0 self,
peer: &'life1 PeerId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn connect<'life0, 'life1, 'async_trait>(
&'life0 self,
peer: &'life1 PeerId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn peers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<PeerInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn peers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<PeerInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn id<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<NodeInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn id<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<NodeInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn dht_find_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
peer: &'life1 PeerId,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn dht_find_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
peer: &'life1 PeerId,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn repo_stat<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RepoStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn repo_stat<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RepoStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn version<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<VersionInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn version<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<VersionInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn block_get<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn block_get<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn block_put<'life0, 'async_trait>(
&'life0 self,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<Cid>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn block_put<'life0, 'async_trait>(
&'life0 self,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<Cid>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn block_stat<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
) -> Pin<Box<dyn Future<Output = Result<BlockStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn block_stat<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
) -> Pin<Box<dyn Future<Output = Result<BlockStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn backend_type(&self) -> BackendType
fn backend_type(&self) -> BackendType
Source§fn is_online<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_online<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn metrics<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<BackendMetrics>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn metrics<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<BackendMetrics>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<HealthStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<HealthStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl Freeze for IrohBackend
impl !RefUnwindSafe for IrohBackend
impl Send for IrohBackend
impl Sync for IrohBackend
impl Unpin for IrohBackend
impl !UnwindSafe for IrohBackend
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more