Struct iroh_sync::actor::SyncHandle
source · pub struct SyncHandle { /* private fields */ }Expand description
The SyncHandle is the handle to a thread that runs replica and store operations.
Implementations§
source§impl SyncHandle
impl SyncHandle
sourcepub fn spawn<S: Store>(
store: S,
content_status_callback: Option<ContentStatusCallback>,
me: String
) -> SyncHandle
pub fn spawn<S: Store>( store: S, content_status_callback: Option<ContentStatusCallback>, me: String ) -> SyncHandle
Spawn a sync actor and return a handle.
pub async fn open(&self, namespace: NamespaceId, opts: OpenOpts) -> Result<()>
pub async fn close(&self, namespace: NamespaceId) -> Result<bool>
pub async fn subscribe( &self, namespace: NamespaceId, sender: Sender<Event> ) -> Result<()>
pub async fn unsubscribe( &self, namespace: NamespaceId, sender: Sender<Event> ) -> Result<()>
pub async fn set_sync(&self, namespace: NamespaceId, sync: bool) -> Result<()>
pub async fn insert_local( &self, namespace: NamespaceId, author: AuthorId, key: Bytes, hash: Hash, len: u64 ) -> Result<()>
pub async fn delete_prefix( &self, namespace: NamespaceId, author: AuthorId, key: Bytes ) -> Result<usize>
pub async fn insert_remote( &self, namespace: NamespaceId, entry: SignedEntry, from: PeerIdBytes, content_status: ContentStatus ) -> Result<()>
pub async fn sync_initial_message( &self, namespace: NamespaceId ) -> Result<Message<SignedEntry>>
pub async fn sync_process_message( &self, namespace: NamespaceId, message: Message<SignedEntry>, from: PeerIdBytes, state: SyncOutcome ) -> Result<(Option<Message<SignedEntry>>, SyncOutcome)>
pub async fn get_sync_peers( &self, namespace: NamespaceId ) -> Result<Option<Vec<PeerIdBytes>>>
pub async fn register_useful_peer( &self, namespace: NamespaceId, peer: PeerIdBytes ) -> Result<()>
pub async fn has_news_for_us( &self, namespace: NamespaceId, heads: AuthorHeads ) -> Result<Option<NonZeroU64>>
pub async fn get_many( &self, namespace: NamespaceId, filter: GetFilter, reply: Sender<Result<SignedEntry>> ) -> Result<()>
pub async fn get_one( &self, namespace: NamespaceId, author: AuthorId, key: Bytes ) -> Result<Option<SignedEntry>>
pub async fn drop_replica(&self, namespace: NamespaceId) -> Result<()>
pub async fn export_secret_key( &self, namespace: NamespaceId ) -> Result<Namespace>
pub async fn get_state(&self, namespace: NamespaceId) -> Result<OpenState>
pub async fn shutdown(&self)
pub async fn list_replicas( &self, reply: Sender<Result<NamespaceId>> ) -> Result<()>
pub async fn import_namespace( &self, namespace: Namespace ) -> Result<NamespaceId>
Trait Implementations§
source§impl Clone for SyncHandle
impl Clone for SyncHandle
source§fn clone(&self) -> SyncHandle
fn clone(&self) -> SyncHandle
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl RefUnwindSafe for SyncHandle
impl Send for SyncHandle
impl Sync for SyncHandle
impl Unpin for SyncHandle
impl UnwindSafe for SyncHandle
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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