pub struct KeySynchronizer { /* private fields */ }Expand description
Sistema principal de sincronização de chaves
Implementations§
Source§impl KeySynchronizer
impl KeySynchronizer
Sourcepub async fn new(config: &ClientConfig) -> Result<Self>
pub async fn new(config: &ClientConfig) -> Result<Self>
Cria nova instância do sincronizador de chaves
Sourcepub fn keypair(&self) -> &LibP2PKeypair
pub fn keypair(&self) -> &LibP2PKeypair
Retorna o keypair do nó
Sourcepub async fn add_trusted_peer(
&self,
peer_id: PeerId,
public_key: VerifyingKey,
) -> Result<()>
pub async fn add_trusted_peer( &self, peer_id: PeerId, public_key: VerifyingKey, ) -> Result<()>
Adiciona peer confiável para sincronização
Sourcepub async fn remove_trusted_peer(&self, peer_id: &PeerId) -> Result<bool>
pub async fn remove_trusted_peer(&self, peer_id: &PeerId) -> Result<bool>
Remove peer confiável
Sourcepub async fn sync_key(
&self,
key_id: &str,
operation: SyncOperation,
) -> Result<()>
pub async fn sync_key( &self, key_id: &str, operation: SyncOperation, ) -> Result<()>
Sincroniza uma chave específica com peers
Sourcepub async fn handle_sync_message(&self, message: SyncMessage) -> Result<()>
pub async fn handle_sync_message(&self, message: SyncMessage) -> Result<()>
Processa mensagem de sincronização recebida
Sourcepub async fn get_statistics(&self) -> SyncStatistics
pub async fn get_statistics(&self) -> SyncStatistics
Obtém estatísticas de sincronização
Sourcepub async fn get_key_sync_status(&self, key_id: &str) -> Option<KeySyncStatus>
pub async fn get_key_sync_status(&self, key_id: &str) -> Option<KeySyncStatus>
Obtém status de sincronização de uma chave
Sourcepub async fn list_synchronized_keys(&self) -> Vec<String>
pub async fn list_synchronized_keys(&self) -> Vec<String>
Lista todas as chaves sincronizadas
Sourcepub async fn force_full_sync(&self) -> Result<()>
pub async fn force_full_sync(&self) -> Result<()>
Força sincronização completa com peers
Sourcepub async fn export_sync_config(&self) -> Result<Vec<u8>>
pub async fn export_sync_config(&self) -> Result<Vec<u8>>
Exporta configuração de sincronização
Auto Trait Implementations§
impl Freeze for KeySynchronizer
impl !RefUnwindSafe for KeySynchronizer
impl Send for KeySynchronizer
impl Sync for KeySynchronizer
impl Unpin for KeySynchronizer
impl !UnwindSafe for KeySynchronizer
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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