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

source

pub fn spawn<S: Store>( store: S, content_status_callback: Option<ContentStatusCallback>, me: String ) -> SyncHandle

Spawn a sync actor and return a handle.

source

pub async fn open(&self, namespace: NamespaceId, opts: OpenOpts) -> Result<()>

source

pub async fn close(&self, namespace: NamespaceId) -> Result<bool>

source

pub async fn subscribe( &self, namespace: NamespaceId, sender: Sender<Event> ) -> Result<()>

source

pub async fn unsubscribe( &self, namespace: NamespaceId, sender: Sender<Event> ) -> Result<()>

source

pub async fn set_sync(&self, namespace: NamespaceId, sync: bool) -> Result<()>

source

pub async fn insert_local( &self, namespace: NamespaceId, author: AuthorId, key: Bytes, hash: Hash, len: u64 ) -> Result<()>

source

pub async fn delete_prefix( &self, namespace: NamespaceId, author: AuthorId, key: Bytes ) -> Result<usize>

source

pub async fn insert_remote( &self, namespace: NamespaceId, entry: SignedEntry, from: PeerIdBytes, content_status: ContentStatus ) -> Result<()>

source

pub async fn sync_initial_message( &self, namespace: NamespaceId ) -> Result<Message<SignedEntry>>

source

pub async fn sync_process_message( &self, namespace: NamespaceId, message: Message<SignedEntry>, from: PeerIdBytes, state: SyncOutcome ) -> Result<(Option<Message<SignedEntry>>, SyncOutcome)>

source

pub async fn get_sync_peers( &self, namespace: NamespaceId ) -> Result<Option<Vec<PeerIdBytes>>>

source

pub async fn register_useful_peer( &self, namespace: NamespaceId, peer: PeerIdBytes ) -> Result<()>

source

pub async fn has_news_for_us( &self, namespace: NamespaceId, heads: AuthorHeads ) -> Result<Option<NonZeroU64>>

source

pub async fn get_many( &self, namespace: NamespaceId, filter: GetFilter, reply: Sender<Result<SignedEntry>> ) -> Result<()>

source

pub async fn get_one( &self, namespace: NamespaceId, author: AuthorId, key: Bytes ) -> Result<Option<SignedEntry>>

source

pub async fn drop_replica(&self, namespace: NamespaceId) -> Result<()>

source

pub async fn export_secret_key( &self, namespace: NamespaceId ) -> Result<Namespace>

source

pub async fn get_state(&self, namespace: NamespaceId) -> Result<OpenState>

source

pub async fn shutdown(&self)

source

pub async fn list_authors(&self, reply: Sender<Result<AuthorId>>) -> Result<()>

source

pub async fn list_replicas( &self, reply: Sender<Result<NamespaceId>> ) -> Result<()>

source

pub async fn import_author(&self, author: Author) -> Result<AuthorId>

source

pub async fn import_namespace( &self, namespace: Namespace ) -> Result<NamespaceId>

Trait Implementations§

source§

impl Clone for SyncHandle

source§

fn clone(&self) -> SyncHandle

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SyncHandle

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32 ) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more