pub struct Handle { /* private fields */ }Implementations§
Trait Implementations§
Source§impl Handle for Handle
impl Handle for Handle
type Events = Events
type Event = Event
Source§fn is_running(&self) -> bool
fn is_running(&self) -> bool
Check if the node is running.
Source§fn connect(
&mut self,
node: NodeId,
addr: Address,
opts: ConnectOptions,
) -> Result<ConnectResult, Error>
fn connect( &mut self, node: NodeId, addr: Address, opts: ConnectOptions, ) -> Result<ConnectResult, Error>
Connect to a peer.
Source§fn seeds_for(
&mut self,
id: RepoId,
namespaces: impl IntoIterator<Item = PublicKey>,
) -> Result<Seeds, Self::Error>
fn seeds_for( &mut self, id: RepoId, namespaces: impl IntoIterator<Item = PublicKey>, ) -> Result<Seeds, Self::Error>
Look up the seeds of a given repository in the routing table
and report sync status for
namespaces.Source§fn listen_addrs(&self) -> Result<Vec<SocketAddr>, Self::Error>
fn listen_addrs(&self) -> Result<Vec<SocketAddr>, Self::Error>
Get the node’s bound listen addresses.
Source§fn fetch(
&mut self,
id: RepoId,
from: NodeId,
timeout: Duration,
) -> Result<FetchResult, Error>
fn fetch( &mut self, id: RepoId, from: NodeId, timeout: Duration, ) -> Result<FetchResult, Error>
Fetch a repository from the network.
Source§fn follow(&mut self, id: NodeId, alias: Option<Alias>) -> Result<bool, Error>
fn follow(&mut self, id: NodeId, alias: Option<Alias>) -> Result<bool, Error>
Start following the given peer.
Source§fn block(&mut self, id: NodeId) -> Result<bool, Self::Error>
fn block(&mut self, id: NodeId) -> Result<bool, Self::Error>
Set the following policy to block for the given peer.
Source§fn seed(&mut self, id: RepoId, scope: Scope) -> Result<bool, Error>
fn seed(&mut self, id: RepoId, scope: Scope) -> Result<bool, Error>
Start seeding the given repo. May update the scope. Does nothing if the
repo is already seeded.
Source§fn unseed(&mut self, id: RepoId) -> Result<bool, Error>
fn unseed(&mut self, id: RepoId) -> Result<bool, Error>
Un-seed the given repo and delete it from storage.
Source§fn announce_refs_for(
&mut self,
id: RepoId,
namespaces: impl IntoIterator<Item = PublicKey>,
) -> Result<RefsAt, Error>
fn announce_refs_for( &mut self, id: RepoId, namespaces: impl IntoIterator<Item = PublicKey>, ) -> Result<RefsAt, Error>
Notify the service that a repository has been updated, and references
for the given
namespaces should be announced over the network.Source§fn add_inventory(&mut self, rid: RepoId) -> Result<bool, Error>
fn add_inventory(&mut self, rid: RepoId) -> Result<bool, Error>
Notify the service that our inventory was updated with the given repository.
Source§fn subscribe(&self, _timeout: Duration) -> Result<Self::Events, Self::Error>
fn subscribe(&self, _timeout: Duration) -> Result<Self::Events, Self::Error>
Subscribe to node events.
Source§fn session(&self, nid: NodeId) -> Result<Option<Session>, Self::Error>
fn session(&self, nid: NodeId) -> Result<Option<Session>, Self::Error>
Query the state of a peer session. Returns
None if no session was found.Auto Trait Implementations§
impl Freeze for Handle
impl RefUnwindSafe for Handle
impl Send for Handle
impl Sync for Handle
impl Unpin for Handle
impl UnsafeUnpin for Handle
impl UnwindSafe for Handle
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,
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