pub struct SyncHandle { /* private fields */ }Expand description
Handle for tracking sync status with a specific peer.
Returned by Sync::register_sync_peer().
Implementations§
Source§impl SyncHandle
impl SyncHandle
Sourcepub async fn status(&self) -> Result<SyncStatus>
pub async fn status(&self) -> Result<SyncStatus>
Get the current sync status.
Sourcepub async fn add_address(&self, address: Address) -> Result<()>
pub async fn add_address(&self, address: Address) -> Result<()>
Add another address hint for this peer.
Sourcepub async fn wait_for_initial_sync(&self) -> Result<()>
pub async fn wait_for_initial_sync(&self) -> Result<()>
Block until initial sync completes (has local data).
This is a convenience method for backwards compatibility. The sync happens in the background, this just polls until data arrives.
Sourcepub fn peer_pubkey(&self) -> &PublicKey
pub fn peer_pubkey(&self) -> &PublicKey
Get the peer public key.
Trait Implementations§
Source§impl Clone for SyncHandle
impl Clone for SyncHandle
Source§fn clone(&self) -> SyncHandle
fn clone(&self) -> SyncHandle
Returns a duplicate 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 !Freeze for SyncHandle
impl !RefUnwindSafe for SyncHandle
impl Send for SyncHandle
impl Sync for SyncHandle
impl Unpin for SyncHandle
impl !UnwindSafe for SyncHandle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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